hi
is there anybody to tell hw to connect java with oracle 8 or oracle 9i......
Thanx ...............
Printable View
hi
is there anybody to tell hw to connect java with oracle 8 or oracle 9i......
Thanx ...............
You can use the java.sql.DriverManager class to connect to a backend.
Here is a rough example
Code: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)
{
}