Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2009
    Posts
    4

    Unanswered: clob db2 jdbc driver problem

    Hi,

    I am getting the following error via jdbc:

    Code:
    com.ibm.db2.jcc.a.SqlException: [jcc][1037][12036][3.52.95] Exception occurred during clob conversion.  See attached Throwable for details. ERRORCODE=-4220, SQLSTATE=null
    	at com.ibm.db2.jcc.a.ad.a(ad.java:650)
    	at com.ibm.db2.jcc.a.ad.a(ad.java:60)
    	at com.ibm.db2.jcc.a.ad.a(ad.java:85)
    	at com.ibm.db2.jcc.a.ee.<init>(ee.java:114)
    	at com.ibm.db2.jcc.t4.d.b(d.java:1463)
    	at com.ibm.db2.jcc.a.fc.a(fc.java:845)
    	at com.ibm.db2.jcc.a.fc.F(fc.java:1312)
    	at com.ibm.db2.jcc.a.gl.d(gl.java:1035)
    	at com.ibm.db2.jcc.a.gl.getString(gl.java:1013)
    	at com.ibm.db2.jcc.a.gl.getString(gl.java:1465)
    	at com.devoncdolitigation.client.TestJDBCdb.test(TestJDBCdb.java:40)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.junit.internal****nners.TestMethod.invoke(TestMethod.java:59)
    	at org.junit.internal****nners.MethodRoadie****nTestMethod(MethodRoadie.java:98)
    	at org.junit.internal****nners.MethodRoadie$2****n(MethodRoadie.java:79)
    	at org.junit.internal****nners.MethodRoadie****nBeforesThenTestThenAfters(MethodRoadie.java:87)
    	at org.junit.internal****nners.MethodRoadie****nTest(MethodRoadie.java:77)
    	at org.junit.internal****nners.MethodRoadie****n(MethodRoadie.java:42)
    	at org.junit.internal****nners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
    	at org.junit.internal****nners.JUnit4ClassRunner****nMethods(JUnit4ClassRunner.java:51)
    	at org.junit.internal****nners.JUnit4ClassRunner$1****n(JUnit4ClassRunner.java:44)
    	at org.junit.internal****nners.ClassRoadie****nUnprotected(ClassRoadie.java:27)
    	at org.junit.internal****nners.ClassRoadie****nProtected(ClassRoadie.java:37)
    	at org.junit.internal****nners.JUnit4ClassRunner****n(JUnit4ClassRunner.java:42)
    	at org.eclipse.jdt.internal.junit4****nner.JUnit4TestReference****n(JUnit4TestReference.java:46)
    	at org.eclipse.jdt.internal.junit****nner.TestExecution****n(TestExecution.java:38)
    	at org.eclipse.jdt.internal.junit****nner.RemoteTestRunner****nTests(RemoteTestRunner.java:467)
    	at org.eclipse.jdt.internal.junit****nner.RemoteTestRunner****nTests(RemoteTestRunner.java:683)
    	at org.eclipse.jdt.internal.junit****nner.RemoteTestRunner****n(RemoteTestRunner.java:390)
    	at org.eclipse.jdt.internal.junit****nner.RemoteTestRunner.main(RemoteTestRunner.java:197)
    Caused by: java.nio.charset.MalformedInputException: Input length = 19
    	at com.ibm.db2.jcc.a.u.a(u.java:19)
    	at com.ibm.db2.jcc.a.ee.<init>(ee.java:110)
    	... 29 more
    Caused by: sun.io.MalformedInputException
    	at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:149)
    	at com.ibm.db2.jcc.a.u.a(u.java:16)
    	... 30 more
    I don't have any probs accessing the clob with python (ibm_db2).
    Seems like a driver problem because the data i uploaded to the clob field has a page-break char. Any idea how to solve this? Don't want to delete all the data and remove the page-break char (^L) from the csv files and load again.

    thanks for the help

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Would you mind posting your java code and the Db2 version and OS?

    Andy

  3. #3
    Join Date
    Oct 2009
    Posts
    4
    The jdbc test code is:
    Same problem if used with hibernate
    Code:
    	@Test
    	public void test() throws SQLException, ClassNotFoundException
    	{
    		String databaseURL = "jdbc:db2://zzzzz.com:57000/ns:fullyMaterializeLobData=true;fullyMaterializeInputStreams=true;progressiveStreaming=2;progresssiveLocators=2;";
    		// Load DB2 Driver for JDBC class
    		Class.forName("com.ibm.db2.jcc.DB2Driver");
    		// Set user and password properties
    		Properties properties = new Properties();
    		properties.put("user", "xxx");
    		properties.put("password", "xxxx");
    		properties.put("retreiveMessagesFromServerOnGetMessage", "true");
    		// Get a connection
    		Connection conn = DriverManager.getConnection(databaseURL, properties); 
    		String query="select * from xxx where proddate='8/21/2009'";
    
    		Statement st = conn.createStatement();
    		
    		ResultSet rs =st.executeQuery(query);
    		String prodid="";
    		 while (rs.next())
    	      {
    //			 try
    //			 {
    				  prodid=rs.getString("PRODUCTIONID");
    				 String s = rs.getString("FULLTEXT");
    				 System.out.println(prodid);
    				 System.out.println(s);
    //			 }
    //			 catch(com.ibm.db2.jcc.a.SqlException e)
    //			 {
    //				 e.printStackTrace();
    //			 }
    	      }
    	}
    }
    db2 level:
    Code:
    B21085I  Instance "db2inst1" uses "64" bits and DB2 code release "SQL09052" 
    with level identifier "03030107".
    Informational tokens are "DB2 v9.5.0.2", "s080811", "MI00239", and Fix Pack 
    "2".
    Product is installed at "/opt/ibm/db2/V9.5".
    uname -a
    Code:
    Linux db 2.6.26-1-xen-amd64 #1 SMP Fri Mar 13 21:39:38 UTC 2009 x86_64 GNU/Linux

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    What happens if you try to use rs.getClob?

    Andy

  5. #5
    Join Date
    Oct 2009
    Posts
    4
    same issue

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Did you do

    String s = rs.getClob

    or

    Clob c = rs.getClob

    Andy

  7. #7
    Join Date
    Oct 2009
    Posts
    4
    Clob c = rs.getClob("FULLTEXT") throws the same exception.
    and the Clob c object does not get constructed


    there is no getClob method in the Resultset returning a string

  8. #8
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Then I suggest you open a PMR with IBM to get the problem fixed.

    Andy

  9. #9
    Join Date
    Oct 2010
    Posts
    2
    Hi, i have the exact same problem, no matter how i try and access that CLOB value, I get that exception. in all fairness the value contains charcters like X00, XFF and so on, but db2 load let me insert it without complaining (using LOBSINFILE)

    even more interestingly though, i have:

    Code:
    (line 1) String string = resultSet.getString(i);
    (line 2) Blob blob = resultSet.getBlob(i);
    this will throw the exception at line 2, but if i comment out line 2, the exception is thrown from line 1! clearly a JVM bug, but kudos to DB2 for stepping right in it..!! it's made my colleagues and i laught a lot, until i realized that was a show stopper for me....
    any suggestions?
    Last edited by anthalamus; 03-24-11 at 19:02. Reason: forgot to format code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •