By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,236 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,236 IT Pros & Developers. It's quick & easy.

Type 4 JDBC driver Bug Check thrown

P: n/a
While accessing unicode data, I get a bug check thrown:
com.ibm.db2.jcc.a.SqlException
at com.ibm.db2.jcc.a.s.a(s.java:1521)
at com.ibm.db2.jcc.a.s.n(s.java:532)
at com.ibm.db2.jcc.a.s.M(s.java:1097)
at com.ibm.db2.jcc.a.zc.getString(zc.java:901)
at com.ibm.db2.jcc.a.zc.getString(zc.java:1232)
at testjdbc.Main.main(Main.java:56)

While accessing unicode data using the getString method.

When I switch it to the Type 2 driver, it works correctly, but I want
to use the Type 4 driver.

This code is simply me troubleshooting the symptom - we use xreporter
and crystal reports for reporting and both are throwing an error on
this record and other such unicode characters.

Our DB encoding is UTF-8

Here's my code:
public static void main(String[] args) {
try {
Class.forName("com.ibm.db2.jcc.DB2Driver");
//Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
String url = "jdbc:db2://reports.bodog.com:50001/OLAPDW";
//String url = "jdbc:db2:OLAPDW";
Properties dbproperties = new Properties();
dbproperties.setProperty("user","db2inst2");
dbproperties.setProperty("password","polo12");
try {
System.out.println ("Connecting");
Connection connection =
DriverManager.getConnection(url,dbproperties);
System.out.println ("Connected");

Statement st = connection.createStatement();
System.out.println ("Running Query");
ResultSet rs = st.executeQuery("select city from contacts where
accountnumber = '628623'");
while (rs.next()) {
//System.out.println (rs.getString("city") );

}
connection.close();

}
catch (SQLException e) {
e.printStackTrace();
//System.out.println (e.getErrorCode());
}

}
catch (Exception e) {
//e.printStackTrace();
}
Does anyone know what I should do? Is there a setting I'm missing?

Oct 3 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
c_********@yahoo.com wrote:
While accessing unicode data, I get a bug check thrown:
Please make sure that the driver on the client is the same used on the
server.

Bernd
Oct 3 '06 #2

P: n/a
Bernd Hohmann wrote:
c_********@yahoo.com wrote:
While accessing unicode data, I get a bug check thrown:

Please make sure that the driver on the client is the same used on the
server.

Bernd
Just copied over db2jcc.jar and db2jcc_license_cu.jar, re ran my java
code and same thing came out.

Oct 3 '06 #3

P: n/a
c_********@yahoo.com wrote:
Just copied over db2jcc.jar and db2jcc_license_cu.jar, re ran my java
code and same thing came out.
Which DB2 version, which OS on the server and which OS on the client?

Bernd
Oct 3 '06 #4

P: n/a
Server: DB2 8.1UDB Linux on RHEL 4
Client XP or RHEL4 (compiled on both, both threw error), using DB2 JCC
drivers (db2jcc.jar, db2jcc_license_cu.jar)

Bernd Hohmann wrote:
c_********@yahoo.com wrote:
Just copied over db2jcc.jar and db2jcc_license_cu.jar, re ran my java
code and same thing came out.

Which DB2 version, which OS on the server and which OS on the client?

Bernd
Oct 4 '06 #5

P: n/a
Are these your real username and password? If so, you better change
them before you get hacked.

c_********@yahoo.com wrote:
dbproperties.setProperty("user","db2inst2");
dbproperties.setProperty("password","polo12");
Oct 4 '06 #6

P: n/a
Wholly crap!

Yeah those have been changed...

Btw, found the cause of the bug.

If anyone cares, the database was set to utf-8 and we loaded in
iso-8859-1 data.

When we converted the data to utf-8 the jdbc driver stopped puking
Captain wrote:
Are these your real username and password? If so, you better change
them before you get hacked.
Oct 4 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.