what is the best way, in terms of performance, to do
multiple insert/update statements, a PreparedStatement or
Batch Updates?

Answers were Sorted based on User's Feedback



what is the best way, in terms of performance, to do multiple insert/update statements, a PreparedS..

Answer / ravi

It depends on the context. If you have many records that
need to be updated and you are not bothered about having
interactive session, I would choose batch. But that raises
the question, where do you store all the transactions that
need to be persisted/updated until the batch runs. Do you
want to store to a temporaray storage before updated. It
depends on the design on the system.

Is This Answer Correct ?    2 Yes 0 No

what is the best way, in terms of performance, to do multiple insert/update statements, a PreparedS..

Answer / nirmal

The easiest way is to use RMI to start the app and check to
see if it's already running.

The basic structure is this:

The main method of your app checks the RMI registry to see
if the app is started. If so, exit.
Otherwise, the main creates an instance of the app (which
is a remote object) and registers it in the RMI registry.
The class' constructor creates the GUI and displays it.
Alternatively, you could create a "start" method that you
call via RMI to start the app.

Is This Answer Correct ?    2 Yes 9 No

Post New Answer

More JDBC Interview Questions

What are dml and ddl?

0 Answers  


What does setautocommit do?

0 Answers  


What is jdbc in java?

0 Answers  


What is two-phase commit in the database?

0 Answers  


Discuss the procedure of retrieving warnings?

0 Answers  






dear friends I have made connection with SQLSERVER where the following code is compiling properly but giving error at the runtime . I think error in this line where i am sending the value through string Connection connection = DriverManager.getConnection ( "jdbc:microsoft:sqlserver://localhost:1433","sa",""); import java.sql.*; //import mssqlserver.*; public class TestSQLCON { public TestSQLCON() throws Exception { // Get connection DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver()); System.out.println(); System.out.println("Successfully connected one"); System.out.println(); Connection connection = DriverManager.getConnection ( "jdbc:microsoft:sqlserver://localhost:1433","sa",""); if (connection != null) { System.out.println(); System.out.println("Successfully connected"); System.out.println(); // Meta data DatabaseMetaData meta = connection.getMetaData(); System.out.println("\nDriver Information"); System.out.println("Driver Name: " + meta.getDriverName()); System.out.println("Driver Version: " + meta.getDriverVersion()); System.out.println("\nDatabase Information "); System.out.println("Database Name: " + meta.getDatabaseProductName()); System.out.println("Database Version: "+ meta.getDatabaseProductVersion()); } } public static void main (String args[]) throws Exception { TestSQLCON test = new TestSQLCON(); } } so please help me

2 Answers  


Is possible to open a connection to a database with exclusive mode with JDBC?

0 Answers  


What are drivers available?

0 Answers  


please tell me the name and url path for type-4 driver ?

1 Answers  


What are the flow statements of jdbc?

0 Answers  


What is the meaning of batch updates?

0 Answers  


What is Type-3 Driver and when this driver is used?

3 Answers   Wipro,


Categories