//2. 建立连接:
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@10.248.13.5:2902:cmcc", "ngca",
"Cmcc_0111"); //报错在建立连接这一行
报错:
java.sql.SQLException: Io 异常: Size Data Unit (SDU) mismatch
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:420)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at jdbc.TestRegister.main(TestRegister.java:23)
jdk1.6 驱动ojdbc14.jar 版本号:10.2.0.2.0
更新oracle驱动试试
确实是oracle驱动的问题,用oracle的最新驱动也就是oracle 10.2.0.4.0 就不会出现问题了