关于JDBC与oracle的问题(Io异常Bad packet type)

dpual 发布于 2012/07/14 21:36
阅读 2K+
收藏 0
import java.sql.*;
public class TestJDBC
{
    public static void main(String[] args) throws Exception
    {
        Class.forName("oracle.jdbc.driver.OracleDriver");
        //new oracle.jdbc.driver.OracleDriver();
        Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.1:1158:em","orcl","orcl");
    }

}

然后报错是:

Exception in thread "main" java.sql.SQLException: Io 异常: Bad packet type
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:231)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:345)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:428)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:515)

请问是哪出现问题了呢??

加载中
0
鉴客
鉴客
建议你更新你的驱动。Oracle 自带的驱动应该叫 ojdbc.jar 用最新版的哦!
0
hunterli
hunterli
版本不匹配吧
返回顶部
顶部