JDBC [message #92292] |
Wed, 19 May 2004 21:46 |
Brayan
Messages: 315 Registered: June 2002
|
Senior Member |
|
|
I'm using JDBC thin drivers. I'm able to connect to the database. But, information access is slower compared to the ODBC.
IS THERE ANY SOLUTION!!!
Wishes,Brayan
|
|
|
Re: JDBC [message #92360 is a reply to message #92292] |
Tue, 15 June 2004 00:25 |
Amith p Jayanthilal
Messages: 5 Registered: June 2004
|
Junior Member |
|
|
Try using this program - let me know if u have any doubts.
import java.sql.*;
public class OracleFromJava{
public static void main(String args[[]]) throws SQLException{
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:AAA",
"scott", "tiger");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery ("select DNAME from DEPT");
while(rset.next()){
System.out.println(rset.getString("DNAME"));
}
rset.close();
conn.close();
}
}
|
|
|