how to resolve error: protocol violation (error code:17401)
I am using jdbc to access the database oracle 8.1.7 on windows, and when I access two lines of a table, no errors occured.But when I access all lines of the table, an error occured:
java.sql.SQLException: N%74P-Ri
what is the problem ?
My program is really very simple,as follows:
import java.lang.*;
import java.io.*;
import java.sql.*;
import java.net.URL;
import oracle.jdbc.driver.*;
public class mytest {
public static void main (String args[]) {
String str4="",str5="",str7="",str8="",str10="",str11="",str13="";
String str14="",str16="",str17="",str24="";
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@172.20.1.41:1521:szxx","dev2002","dev2002");
Statement stmt=conn.createStatement();
String sql="select GSJB0004,GSJB0005,GSJB0007,GSJB0008,GSJB0010,GSJB0011,GSJB0013,GSJB0014,GSJB0016,GSJB0017,GSJB0024 from FRM_GSJBGK where GSJB0008='shanghai'";
ResultSet rs=stmt.executeQuery(sql);
int i=1;
while (rs.next()) {
str4=rs.getString("GSJB0004");
str5=rs.getString("GSJB0005");
str7=rs.getString("GSJB0007");
str8=rs.getString("GSJB0008");
str10=rs.getString("GSJB0010");
str11=rs.getString("GSJB0011");
str13=rs.getString("GSJB0013");
str14=rs.getString("GSJB0014");
str16=rs.getString("GSJB0016");
str17=rs.getString("GSJB0017");
str24=rs.getString("GSJB0024");
System.out.println("*******");
System.out.println(i);
System.out.println(str4+"|"+str5+"|"+str7+"|"+str8+"|"+str10+"|"+str11+"|"+str13+"|"+str14+"|"+str16+"|"+str17+"|"+str24);
i++;
}
}
catch (SQLException e) {
System.err.println(e.getErrorCode());
e.printStackTrace();
}
catch (Exception e) {
System.err.println("mytest():"+e.getMessage());
}
}
}
all the fields such as GSJB0004 is varchar2, the largest is about 90.
any suggestions is welcome!
Thank you!
my e-mail is :caroline_hy@163.com