0

hi everyone,
i am looking for a brief introduction as to what exactly is jdbc and how do i install and use jdbc drivers with oracle 9i. and how shoud i write a code to execute queries on the tables in my oracle 9i database.

3
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by ramamoorthy
0

hi everyone,
i am looking for a brief introduction as to what exactly is jdbc and how do i install and use jdbc drivers with oracle 9i. and how shoud i write a code to execute queries on the tables in my oracle 9i database.

It all depends on your Java environment. Wherever your Java code executes, it needs access to the Oracle JDBC class files. This means that the class files must reside in the classpath of your application. If you are running a Java web application in a Java Application Server such as WebSphere or Tomcat, you will typically place class files in the /WEB-INF/lib folder of your application.

Please refer to Google.

0

JDBC acts like bridge between your front-end (may be web-application,jsp,vb,form etc.,)and back-end(database). JDBC will talk to you db.

Choose appropriate jdbc drivers for Oracle9i. Ensure that jdbc drivers available in your machine through Settings/ControlPanel in Windows.

The simple code fragments:
Class.forName("sun.jdbc.odbc.JdbcOdbc");
Connection conn=DriverManager.getConnection(dsn,"username",pwd");
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select * from x");

while(rs.next()){
System.out.println(rs.getString(1));


}

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.