Click to See Complete Forum and Search --> : java oracle connectivity
rupakdutta
Sep 10th, 2005, 02:45 PM
hi
is there anybody to tell hw to connect java with oracle 8 or oracle 9i......
Thanx ...............
Dillinger4
Sep 10th, 2005, 05:24 PM
You can use the java.sql.DriverManager class to connect to a backend.
moinkhan
Sep 11th, 2005, 01:32 AM
Here is a rough example
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:oracle:thin:@" + "rs4" + ":" + "1521" + ":" + "devlop";
Connection con = DriverManager.getConnection(url,"express","care");
PreparedStatement pst = con.prepareStatement("Select " + sysdate + " from dual");
ResultSet rst = pst.executeQuery();
if(rst.next())
{
String num = rst.getString(1);
setVariable(varname,num);
msg=" OK";
return num +"";
}
}
catch(Exception e)
{
}
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.