异常:
testing oracle-character-set-1 against
PASSED LOSSY
testing oracle-character-set-1 against
PASSED LOSSY
testing oracle-character-set-1 against
PASSED LOSSY
testing oracle-character-set-1 against
PASSED LOSSY
testing oracle-character-set-31 against
PASSED LOSSY
testing oracle-character-set-31 against
PASSED LOSSY
testing oracle-character-set-31 against
PASSED LOSSY
testing oracle-character-set-31 against
PASSED LOSSY
testing oracle-character-set-870 against
PASSED
testing oracle-character-set-870 against
PASSED
testing oracle-character-set-870 against
PASSED
testing oracle-character-set-870 against
PASSED
testing oracle-character-set-871 against
PASSED
testing oracle-character-set-871 against
PASSED
testing oracle-character-set-871 against
PASSED
testing oracle-character-set-871 against
PASSED
源码:
import java.sql.*;
public class Db {
PreparedStatement ps=null;
Connection ct=null;
ResultSet rs=null;
Db(){
try{
Class.forName("oracle.jdbc.OracleDriver");
ct=DriverManager.getConnection("jdbc:oracle:thin:
@127.0.0.1 :1521:ORC1","scott","scott");
ps=ct.prepareStatement("select * from emp");
rs=ps.executeQuery();
while(rs.next()){
System.out.println(rs.getString(2));
}
}catch(Exception e){
e.printStackTrace();
}
}
public static void main(){
new Db();
}
条件:
jdk1.6
ojdbc6.jar
表结构: