第一次连接ORACLE,居然......
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:test";
String user="DDR";
String password="ddr";
Connection conn=null;
try
{
conn=DriverManager.getConnection(url,user,password);
}
catch(SQLException e)
{
out.println(e.toString());
}
try
{
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql="SELECT * FROM T1";
ResultSet rs=stmt.executeQuery(sql);
while(rs.next())
{
out.println(String.valueOf(rs.getInt("ID")));
}
rs.close();
stmt.close();
conn.close();
}
catch(Exception ex)
{
out.println(ex.toString());
}
java.sql.SQLException: No suitable driver java.lang.NullPointerException
需要怎么解决~!