You can do it like this
import java.sql.*;
import java.math.*;
public class NewProfileTest
{
public static void main(String[] args)
{
Connection con = null;
Statement stmt;
try
{
Class.forName ("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection
("jdbc:oracle:thin:@10.25.83.19:1512:PROFILE","newprofile","newprofile");
stmt = con.createStatement();
stmt.close();
con. close();
}
catch(java.lang.ClassNotFoundException e)
{
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
catch(SQLException ex)
{
System.err.println("sQLException: " + ex.getMessage());
}
}
}
or leave it as you have it and remove line 8 Class.forName ("oracle.jdbc.driver.OracleDriver"); plus line 10 onli declaration Connection con =null;
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902