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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem in connecting to Oracle DB thru JAVA.

Status
Not open for further replies.

ketankshah

IS-IT--Management
Jan 11, 2001
121
IN
I have written a simple java application which connects to Oracle Personal Edition 8.1.5.0 database on WIN98. I have written following scripts for database connection.{

public static void main (String args [])
throws SQLException, IOException
{
try{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

System.out.println ("Connecting...");

Connection conn =
DriverManager.getConnection ("jdbc:eek:racle:eek:ci8:mad:TEST", "scott","tiger"); // TEST is a TNS name

System.out.println ("connected.");
Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery ("select 'Hello World' from dual");

while (rset.next ())
System.out.println (rset.getString (1));

System.out.println ("Your JDBC installation is correct.");

rset.close();
stmt.close();
conn.close();

}
catch(SQLException sqle)
{
System.out.println("SQL Exception");
System.out.println(sqle.getMessage());
}
catch(Exception e)
{
System.out.println("Exception");
System.out.println(e.getMessage());
}
}

There are no complilation errors. But while running it is crashing with the following error :

Connecting...

Then poping up the Illegal operation window with following message.
JAVA caused an invalid page fault in module JAVAI.DLL at 0167:6ee0fb83.

While testing the TNS name it is connecting to the database successfully.

Please help.

Ketan
 
Hi Ketan,
I read your probl... , you may solve your problem with reinstallation of java 1.2 ....

Arvind Jain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top