Explain creation of statement object with connection method create method with help of an example.


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More JDBC Interview Questions

How to get the Database server details in java program?

0 Answers  


signature of init method?

2 Answers  


Statement, PrepareStatement and Callable all these are interfaces. Thought it is a interface how come we are creating objects and calling methods("preparestatement()") in it. In which class this method is defined. Please let me know. Thanks in advance. example: PreparedStatement pre = con.prepareStatement( "UPDATE COFFEES SET SALES = ? WHERE COF_NAME LIKE ?");

2 Answers  


What is jdbc and odbc?

0 Answers  


How can you tune SQL statements?

2 Answers   Wipro,






Write an sql to find all records having all numeric characters in a field ?

0 Answers  


What are the classes and methods used for sending sql statements to database?

0 Answers  


java.lang.ClassNotFoundException:oracle.jdbc.driver.OracleDr iver? I get this error at run time.I used oracle10G. I set CLASS PATH:C:\oraclexe\app\oracle\product\10.2.0 \server\jdbc\lib\ojdbc14.jar; I write JDBC PROGRAM like import java.sql.*; class Example { public static void main(String args[]) { try { Class.forName ("oracle.jdbc.driver.OracleDriver"); System.out.println("Driver Loaded"); Connection con=DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:xe","system","salmas"); System.out.println("Driver Connected"); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("select * from emp"); while(rs.next()) { System.out.println(rs.getInt(1)); System.out.println(rs.getString(2)); System.out.println(rs.getString(3)); } st.close(); con.close(); } catch(Exception e) { System.out.println(e); } finally { System.out.println("it's finally block executed"); } } }

6 Answers   CTS,


How MS-Access DB can be accessed over a network, using JDBC API?

0 Answers  


What is the advantage of namedparameterjdbctemplate?

0 Answers  


What is the use of callablestatement? Name the method, which is used to prepare a callablestatement.

0 Answers  


MY code is: public class P1{ public static void main(String ar[]) { class.forName("java.lang.String"); } } errors i got are :New.java:5: error: <identifier> expected class.forName("java.lang.String"); ^ New.java:5: error: invalid method declaration; return type required class.forName("java.lang.String"); ^ New.java:5: error: illegal start of type class.forName("java.lang.String"); ^ New.java:7: error: reached end of file while parsing } ^ 4 errors HELP ME>......

3 Answers  


Categories