GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

What does this transaction block do if the second insert fai…

What does this transaction block do if the second insert fails? Connection con = DriverManager.getConnection(url, user, pass); con.setAutoCommit(false); try { Statement stmt = con.createStatement(); stmt.executeUpdate(“INSERT INTO users(name) VALUES (‘John’)”); stmt.executeUpdate(“INSERT INTO users(email) VALUES (‘test@example.com’)”); // Fails con.commit(); } catch (SQLException e) { con.rollback(); System.out.println(“Rolled back”); }

Read Details

Which of the following is used to declare a method or variab…

Which of the following is used to declare a method or variable in JSP?

Read Details

What will happen in the following code?  List

What will happen in the following code?  List

Read Details

What will be the output of the following code?  import java….

What will be the output of the following code?  import java.util.*; public class Test { public static void main(String[] args) { List list = List.copyOf(Arrays.asList(“X”, “Y”, “Z”)); list.add(“W”); } }

Read Details

What is the state of a thread after the start() method is ca…

What is the state of a thread after the start() method is called but before run() begins execution?

Read Details

What will be the output order of the messages below? Threads…

What will be the output order of the messages below? Threads call print(“A”), print(“B”), print(“C”) on the same instance. class Printer { void print(String msg) { synchronized(this) { System.out.println(“[” + msg + “]”); try { Thread.sleep(100); } catch (InterruptedException e) {} } } }

Read Details

The two leading causes of death among the elderly are heart…

The two leading causes of death among the elderly are heart disease and _____.

Read Details

Children with _____ would always be interpreted as overweigh…

Children with _____ would always be interpreted as overweight on standard growth charts because they have altered muscle size and/or short statures.

Read Details

The majority of older Americans have one or more chronic dis…

The majority of older Americans have one or more chronic diseases.

Read Details

Which of the following is not one of the three diagnosable e…

Which of the following is not one of the three diagnosable eating disorders?

Read Details

Posts pagination

Newer posts 1 … 26,686 26,687 26,688 26,689 26,690 … 79,380 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top