![]() |
| 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 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 ... A) Regular Statement (use createStatement method)B) Prepared statement (use prepareStatement method)C) Callable statement (use prepareCall).D) Interim statement (use jdbcCall). Latest Answer : Interm Statement ... Which of the following values can be replaced in the place of 1 and 2 belowStatement stmt = con.createStatement(1, 2); A) ResultSet. TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLYB) ResultSet. TYPE_SCROLL_INSENSITIVE , ResultSet. CONCUR_UPDATABLEC) ResultSet. CONCUR_UPDATABLE,ResultSet. TYPE_SCROLL_SENSITIVED) ResultSet. State true or false :- ResultSet.CONCUR_UPDATABLE used with the result set is used to update the rows directly in the database. A) TrueB) FalseExplanation: This is the new feature in the JDBC 2.0 API usage is Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); A) TRANSACTION_READ_UNCOMMITTEDB) TRANSACTION_READ_ COMMITTEDC) TRANSACTION_SERIALIZABLED) TRANSACTION_REPEATABLE_READ.Explanation: A non-repeatable read is where one transaction reads a row, a second Latest Answer : a,b ... Which of the following values can be replaced in the place of 1 and 2 below Statement stmt= con.createStatement(1,2);a) ResultSet. TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLYb) ResultSet. TYPE_SCROLL_INSENSITIVE, Latest Answer : Here a and b can be used for (1,2) place respectivly. ...
Sponsored Links
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||