If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > TYPE 4 Driver and Graphic type Column ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-12-04, 07:09
JHS4232 JHS4232 is offline
Registered User
 
Join Date: Aug 2003
Posts: 5
Question TYPE 4 Driver and Graphic type Column ?

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").newInst ance();
} 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();
}
}
}
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On