Thursday, September 18, 2008

Database Connectivity between oracle10g and netbeans 5.5


The code goes like this :


Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con=DriverManager.getConnection("jdbc:odbc:msdaora","username",
"password");

Statement stmt = con.createStatement();

Resultset rs=stmt.executeQuery("select * from table name");


Here username and password is the username and password of your database which you are using (eg. oracle,Microspft sql server etc.) and table name refers to the table name that you want to import from database.


No comments: