What class.Forname will do while loading drivers?
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 DBMS.
What packages are used by JDBC?
There are 8 packages: Java.Sql.Driver, connection,statement, preparedstatement, callablestatement, resultset, resultsetmetadata, databasemetadata.
Packages are
java.sql and javax.sql only..
Those mentioned in the previous lists are the classes & interfaces in those packages.
java.sql.BatchUpdatException Provides information about errors that occurred during batch operations java.sql.Blob Provides access to and manipulation of Binary Large Object data  ...
How can you retrieve data from the resultset?
First JDBC returns results in a resultset object, so we need to declare an instance of the class resultset to hold our results. The following code demonstrates declaring the resultset object rs.E.G.Resultset rs = stmt.Executequery("select cof_name, price from coffees");second:string s = rs.Getstring("cof_name");the...
import java.sql.*;class JDBCtableread{ public static void main(String args[])throws Exception { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url="jdbc:odbc:dsn2";//dsn name ...
Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(SELECT COF_NAME, PRICE FROM COFFEES"); while (rs .next() ) { //Iam assuming there are 3 columns in th...
How to call a stored procedure from JDBC?
The first step is to create a callablestatement object. As with statement an and preparedstatement objects, this is done with an open connection object. A callablestatement object contains a call to a stored procedure;e.G.Callablestatement cs = con.Preparecall("{call show_suppliers}");resultset rs =...
Stored Procedures can be called in java by using the prepareCall() method which returns a CallableStatement object.
CallableStatement cs = con.prepareCall("{call Procedure_name}");
ResultSet rs = cs.executeQuery();
This document demonstrates how to return a JDBC ResultSet as REF CURSOR from a Java Stored Procedure. JDBC ResultSet is a table of data representing a database, which is usually generated by executing...
JDBC is a layer of abstraction that allows users to choose between databases. It allows you to change to a different database engine and to write to a single API. JDBC allows you to write database applications in Java without having to concern yourself with the underlying details of a particular database.
JDBC is a core API of Java 1.1 and later which provides a standard set of interfaces to SQL-compliant databases.
Call-level interfaces such as JDBC are programming interfaces allowing external access to SQL database manipulation and update commands. They allow the integration of SQL calls into a general programm...
Batch Updates are nothing but a bunch of updations that are done at a time without interruption. All the update statements are added to a Batch by using the addBatch() method and the Batch is&nbs...
we can add batch system using add.batch();
What are the different types of statements?
1.Statement (use createstatement method) 2. Prepared statement (use preparestatement method) and 3. Callable statement (use preparecall)
try { Connection conn = DriverManager.getConnection("URL",'USER"."PWD"); //For Simple statement used for static query. Statement stmt = conn.createStatement(); &n...
SQLwarning objects are a subclass of SQLexception that deal with database access warnings. Warnings do not stop the execution of an application, as exceptions do; they simply alert the user that something did not happen as planned. A warning can be reported on a connection object, a statement object...
it is used tom initialize the driver .
class.forName()method create an instance of specified driver, loads that driver, and then register that driver with the DriverManager class.