![]() |
| Home | Tech FAQ | Interview Questions | Placement Papers | Tech Articles | Learn | Freelance Projects | Online Testing | Geeks Talk | Job Postings | Knowledge Base | Site Search | Add/Ask Question |
![]() Related Questions Answered by Jey on 2005-05-10 06:01:10: Here are the steps. Using DriverManager: 1. Load the driver class using class.forName(driverclass) and class.forName() loads the driver class and Latest Answer : First we register the connection and after that we connect the database, in that we give to which database is connecting giving that ipaddress ,port number,username and password . ... 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 Latest Answer : Class.forName is used to create an instance of the driver and register with the DriverManager. ... 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 Latest Answer : JDBC is a core API of Java 1.1 and later which provides a standard set of interfaces to SQL-compliant databases. ... One implementation interface for database manufacturers, the other implementation interface for application and applet writers. Latest Answer : JDBC has four major components:1.The JDBC API2.The JDBC Driver Manager3.The JDBC Test Suite4.The JDBC-ODBC Bridge The first two components of JDBC,the JDBC API and the JDBC Driver Managermanages to connect to the database ... Create an instance of a JDBC driver or load JDBC drivers through jdbc.driversRegister a driverSpecify a databaseOpen a database connectionSubmit a queryReceive results Latest Answer : import java.sql.*;class Type1 { public static void main(String[] args)throws Exception { Connection c=null; try { Driver d=new Driver("sun.jdbc.odbc.JdbcOdbc"); //or ... A Statement object is what sends your SQL statement to the DBMS. You simply create a Statement object and then execute it, supplying the appropriate execute method with the SQL statement you want to send. Latest Answer : Using Statement interface we can create JDBC statements as follows
Statement stmt=con.createStatement();here con is the connection object reference
Different types of statements are
Prepared Statement - whenever we want to execute single ... 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 Latest Answer : 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 Connection con=DriverManager.getConnection(url); ... 1.Statement (use createStatement method) 2. Prepared Statement (Use prepareStatement method) and 3. Callable Statement (Use prepareCall) Latest Answer : try { Connection conn = DriverManager.getConnection("URL",'USER"."PWD"); //For Simple statement used for static query. Statement stmt = conn.createStatement(); //For a runtime / dynamic query .Where String is ... 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 Another new feature in the JDBC 2.0 API is the ability to update rows in a result set using methods in the Java programming language rather than having to send an SQL command. But before you can take advantage Latest Answer : New Features of JDBC2.0To make a updateble resultset use,Resultset.CONCUR_UPDATABLE ...
Sponsored Links
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||