i am trying to connect my java program to oracle but i am nt able to do that . please help me to do that
in j2se one package is ther java.sql which contains all the interfaces
which facilitates not only to connect with data base but also to interact with
data base.
steps to connect to any data base
1)create the driver object
2) register the driver.
3)connect database
java.sql.Driver d=new oracle.jdbc.driver.OracleDriver();
java.sql.DriverManager.registerDriver(d);
java.sql.Connection con=DriverManager.getConnection("jdbc:oracle:thin: @localhost:1521:orcl","scott","tiger");
now your java prog is connected to Oracle 8i.
one thing driver is specific to the DAtabase.
for oracle the set CLASSPATH pointing classes12.jar
similarly for other databasesi f you want to connect. you have to set the jar file to CLASSPATH.
hope this will help you to connect.