Hi All
I got the following error(the title message)
what is the problem plz?
===============================
import java.sql.*;
import java.util.*;
public class attemptConnection_Without_ClassForName
{
public static void main(
String arg[])
{
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
//String sqlStatement="select check_number,posting_date,amount,transaction_number from checkInfo";
String sqlStatement="SELECT * FROM checkInfo where posting_date="+"'"+"28-JAN-2001"+"'";
try
{
//Class.forName("oracle.jdbc.driver.OracleDriver");
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
con = DriverManager.getConnection("jdbc
racle
ci8:@localhost","db2admin","db2admin");
stmt = con.createStatement();
rs = stmt.executeQuery(sqlStatement);
while(rs.next())
{
System.out.println(rs.getInt("check_number") + " "+rs.getDate("posting_date") +" "+rs.getInt("amount")+" "+rs.getInt("transaction_number"));
}
}
/*
catch(ClassNotFoundException e)
{
System.out.println("Couldn't load database driver: " + e.getMessage());
}
*/
catch(SQLException e)
{
System.out.println("SQLException caught: " + e.getMessage());
}
finally
{
try
{
if(con != null) con.close();
}
catch(SQLException ignored){}
}
}
}