ketankshah
IS-IT--Management
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 ("jdbcracleci8TEST", "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
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 ("jdbcracleci8TEST", "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