What is the difference between executeupdate() and executequery() in JDBC ?
What is the most common example type 1 driver
Java Native Interface (JNI)
JDBC - update many table on single submit
How to achieve a single value from web page to be updated/stored in many tables ?
To update data in multiple table using single click ,we can go with triggers in database.we have different types of triggers like after insert,after update,after delete.Better using triggers.
By using Transactions.
Every JDBC Driver will be able to perform Transactions. But its not recommended.
If we want to use out own Transactions we will set
con.setAutoCommit(false); and after executing the transactions we will execute con.commit();
What is the difference between resultset and rowset
ResultSet rs; where rs is treat like a cursor to a database.if the connection is alive then only we can retrieve the information through resultset object.
RowSet rs;We can retrieve data through rowset object with out depending upon the connection is alive or not.
If the connection is alive, then only the values remain in a ResultSet, where as in RowSet,once we get the results connection need not be alive.
How can we retrieve a whole row of data at once in JDBC ?
As of now it is not possible.
Usually Acquiring the connection is time consumption task. In order to avoid that situations, we are reusing already created connection objects. This requirement doesnot support DriverManager interface, we have interface DataSource in javax.sql package.
Connection Pooling is like a Library of books from where you borrow books and return after you are done using it for others to use; only in connection pooling instead of books you have connections in ...
JDBC - pre compile and sored procedure
As prepare statement also precompiles the SQL stmt & stored procedure also compiles the stmt once &den execute the same,then what is the diff between these 2 stmts?
Constructor does not have any return type .. the answer is ,we don't have ny rights to call constructor , we can't invoke the constructor but at the type of object creation constructor automatically g...
"c class hello { void hello(int x) { System.out.print("hi"); } } class main { public static void main(String[] s) { hello ab=new hello(); ...
What methods did you use for retrieving data form a resultset object
The getX() method is used, where X is String or Int depending on the type used in the database.
getString() method is used to retrieve data from the resultset
What must be done by the system administrator in order for a programmer to use the data source?
If you dont close a connection in a web application, what will happen?
Always you should close connection. In some cases exception is thrown. When more processes get active in the same.
If you don't close the connection,your application will eat up all your connection and your application will run out of connection and server will give error as no active connection and your application won't work.
What are the three statements in JDBC & differences between them
Answered by jey on 2005-05-10 05:53:50: 1.Statement which is used to run simple SQL statements like select and update 2. Preparestatment is used to run pre compiled SQL. 3. Callablestatement is used to execute the stored procedures.
class.forname is used to load a class.
When we are making database connectivity then class.forname(................) must be the first statement.
three statements in jdbc1. statement : whic is used to execute select and non select queries.2. PreapreStatement : which is also used to execute select and non select queries but PrepareStatement whic...
When you execute a SQL query using JDBC, do you get a complete recordset or the partial recordset?
What class.Forname( ) method will do
Answered by jey ramasamy on 2005-05-10 05:50:07: class.Forname() is used to load the driver class which is used to connect the application with database. Here driver class is a Java class provided by database vendor.
It is used to create an instance of a driver and register it with the DriverManager. When you have loaded a driver, it is available for making a connection with a Database.
Class.forName is used to create an instance of the driver and register with the DriverManager.
How many statements can be created with one connection
As many as you want, as long as it's one-at-a-time and you reset the Statement object after each usage:
Statement st=con.createStatement(SQL_String1)
ResultSet rs=st.executeQuery();
//process rs here
st.close();
st=null;
st=con.createStatement(SQL_String2)
etc
etc
no upper bound
Explain working of Java virtual machine (jvm) explain the working cycle of the JDBC-ODBC connectivity?
As the question says JVM and JDBC, let me tell you what JVM is initially,JVM is java virtual machine which is platform dependent but Java is platform independent and its source code can be executed on...
Difference between local and GLobal transaction?
The primary difference is that local transaction are single JVM level while global transaction are at multiple JVM level and hence global transactions need different design approach [which can be clas...
A transaction is atomic unit of Work.The tasks which are made into the transaction act as a unit which can be executed successfully all,or if at least one task fails to its promise ,then the effect of...
What is difference b/w type-1 and type-4 JDBC driver with example ?
Give me brief description with small example
Type1: JDBC-ODBC Bridge driverThis is a "birdge" driver, Translates all JDBC calls into ODBC calls and sends them to ODBC driver and ODBC inturn will communicate with a database. The Java Na...
Type 1 JDBC-ODBC Bridge.Translate JDBC call into ODBC call and sends them to ODBC Driver. Pros - All most ODBC Drivers are already available.Cons - Performance Degrade Type 4 A native-pr...
A) a middle tier is introduced in this model.B) collection of SQL statements from the client and handing it over to the database.C) maintaining control over accessing and updating of receiving results from database to the client.D) all of the above.
Answer is option D
A is the correct one.
What is the purpose of creating ODBC data source in establishing a connection between Java application & database?
ODBC stands for open database connectivity which helps us to connect then link from Java to database..so if we want to connect from Java to any database one way is to use ODBC which helps to connect Java to any database (like Oracle, MySQL..).
Shine pattern has JConnection for connecting to any database.
executeQuery() is used for Select statements.
executeUodate() is used for insert,update,delete statements..
executeQuery() is used for Select statements.executeUodate() is used for insert,update,delete statements..