I programmed java using type 4 driver.
I had queried the Graphic column.
(Staffg of the IBM sample DB)
When I used to type 2 and type 3 , I succeed to the results. But, When I used to type 4, It occurred the error.
OS : Windows XP
DB2 V8.1.5
Error :
Connect Error
com.ibm.db2.jcc.c.SqlException: unsupported encoding Cp971 for result set column
at com.ibm.db2.jcc.c.i.a(i.java:377)
at com.ibm.db2.jcc.b.bz.a(bz.java:2246)
at com.ibm.db2.jcc.b.bd.a(bd.java:3127)
at com.ibm.db2.jcc.b.bd.a(bd.java:1726)
at com.ibm.db2.jcc.b.bd.a(bd.java:1660)
at com.ibm.db2.jcc.b.bd.n(bd.java:557)
at com.ibm.db2.jcc.b.bd.j(bd.java:246)
at com.ibm.db2.jcc.b.bd.c(bd.java:56)
at com.ibm.db2.jcc.b.r.c(r.java:53)
at com.ibm.db2.jcc.b.bs.h(bs.java:166)
at com.ibm.db2.jcc.c.cw.n(cw.java:1117)
at com.ibm.db2.jcc.c.cw.a(cw.java:1732)
at com.ibm.db2.jcc.c.cw.a(cw.java:408)
at com.ibm.db2.jcc.c.cw.executeQuery(cw.java:392)
at myjdbc.main(myjdbc.java:29)
I don't know the reason. Is't the reason the DB2 or WAS?
Please Help..!
I am apprehensive the developer's problem.
-------
Program Source
-------
import java.sql.*;
class myjdbc {
static {
try {
Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String argv[]) {
Connection con = null;
String url = "jdbc:db2:sample";
String user = "db2inst1";
String pswd = "db2inst1";
try {
try {
con = DriverManager.getConnection( url );
} catch (Exception e) {
e.printStackTrace();
}
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * from staffg");
System.out.print("Received results:\n\n");
while (rs.next()) {
String a = rs.getString(1);
String str = rs.getString(2);
System.out.print(" ID= " + a + " JOB= " + str + "\n");
}
rs.close();
stmt.close();
con.close();
} catch( Exception e ) {
System.out.print("Connect Error\n");
e.printStackTrace();
}
}
}
I had queried the Graphic column.
(Staffg of the IBM sample DB)
When I used to type 2 and type 3 , I succeed to the results. But, When I used to type 4, It occurred the error.
OS : Windows XP
DB2 V8.1.5
Error :
Connect Error
com.ibm.db2.jcc.c.SqlException: unsupported encoding Cp971 for result set column
at com.ibm.db2.jcc.c.i.a(i.java:377)
at com.ibm.db2.jcc.b.bz.a(bz.java:2246)
at com.ibm.db2.jcc.b.bd.a(bd.java:3127)
at com.ibm.db2.jcc.b.bd.a(bd.java:1726)
at com.ibm.db2.jcc.b.bd.a(bd.java:1660)
at com.ibm.db2.jcc.b.bd.n(bd.java:557)
at com.ibm.db2.jcc.b.bd.j(bd.java:246)
at com.ibm.db2.jcc.b.bd.c(bd.java:56)
at com.ibm.db2.jcc.b.r.c(r.java:53)
at com.ibm.db2.jcc.b.bs.h(bs.java:166)
at com.ibm.db2.jcc.c.cw.n(cw.java:1117)
at com.ibm.db2.jcc.c.cw.a(cw.java:1732)
at com.ibm.db2.jcc.c.cw.a(cw.java:408)
at com.ibm.db2.jcc.c.cw.executeQuery(cw.java:392)
at myjdbc.main(myjdbc.java:29)
I don't know the reason. Is't the reason the DB2 or WAS?
Please Help..!
I am apprehensive the developer's problem.
-------
Program Source
-------
import java.sql.*;
class myjdbc {
static {
try {
Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String argv[]) {
Connection con = null;
String url = "jdbc:db2:sample";
String user = "db2inst1";
String pswd = "db2inst1";
try {
try {
con = DriverManager.getConnection( url );
} catch (Exception e) {
e.printStackTrace();
}
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * from staffg");
System.out.print("Received results:\n\n");
while (rs.next()) {
String a = rs.getString(1);
String str = rs.getString(2);
System.out.print(" ID= " + a + " JOB= " + str + "\n");
}
rs.close();
stmt.close();
con.close();
} catch( Exception e ) {
System.out.print("Connect Error\n");
e.printStackTrace();
}
}
}