Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

oracle8 and jdk1.2

Status
Not open for further replies.

sops

Programmer
Joined
Oct 19, 2001
Messages
1
Location
US
I want to connect to oracle 8 using jdk1.2 can anyone
help me write the database connection statements for this ...
i know how to connect to Sqlserver ..but cant do it with oracle...please
help.
thanking u
 
import java.sql.*;
import java.util.Observable;


public class DataBase extends Observable {

// Private variables used for keeping the connection
// open

private Connection conn;

//DatabaseURL should be something like
//free.oracleserver.com:1521:ORCL

public Database(String databaseURL, userID, password) {


// load the Oracle JDBC-driver
try {
DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());
}
catch (java.sql.SQLException se1) { }

//making a connection

String connectString = "jdbc:oracle:thin@"+databaseURL;

try {
conn = DriverManager.getConnection
(connectString,userId,password);
}

catch (java.sql.SQLException se2) {}


}

}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top