7 messages in com.mysql.lists.javaRe: Invalid data coming from JDBC driver| From | Sent On | Attachments |
|---|---|---|
| Marc Dumontier | 21 Apr 2004 13:58 | |
| Marc Dumontier | 21 Apr 2004 21:37 | |
| Gary Byatt | 21 Apr 2004 23:30 | |
| Marc Dumontier | 22 Apr 2004 06:30 | |
| Mark Matthews | 22 Apr 2004 06:51 | |
| Marc Dumontier | 22 Apr 2004 08:07 | |
| Mark Matthews | 22 Apr 2004 08:23 |
| Subject: | Re: Invalid data coming from JDBC driver![]() |
|---|---|
| From: | Marc Dumontier (mrdu...@blueprint.org) |
| Date: | 04/21/2004 09:37:28 PM |
| List: | com.mysql.lists.java |
Hi,
Here's an update
If i insert in a document which is 16MB-1 bytes, retrieval is ok If i insert in a document which is 16MB+1 bytes, retrieval is not ok If i insert in a document which is 16MB, an exception is thrown during retrieval
java.sql.SQLException: null: at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:725) at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:279) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1001) at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:928) at com.mysql.jdbc.Connection.execSQL(Connection.java:1871) at com.mysql.jdbc.Connection.execSQL(Connection.java:1805) at com.mysql.jdbc.Statement.executeQuery(Statement.java:1143) at org.blueprint.common.db.DbManager.executeQuery(DbManager.java:428) at FetchFromDb.main(FetchFromDb.java:21) Exception in thread "main" java.lang.NullPointerException at FetchFromDb.main(FetchFromDb.java:22)
Hope this helps
-- Marc Dumontier Bioinformatics Software Developer The Blueprint Initiative - North America 522 University Ave. Toronto, Ontario, Canada M5G 1W7 http://www.blueprint.org
----- Original Message ----- From: "Marc Dumontier" <mrdu...@blueprint.org> To: <ja...@lists.mysql.com> Sent: Wednesday, April 21, 2004 4:58 PM Subject: Invalid data coming from JDBC driver
Hi,
I have a record which is 'large'. It's about 20MB of XML data. I can get it properly using the mysql client program
echo "SELECT XMLRecord from BINDSubmit" | mysql -u xxx -p xxx BINDSubmit
record.xml
When i try to SELECT it out using the JDBC Driver (version 3.0.8) I get the following data back. It's basically the record, with 4 null characters are the start, and 4 characters missing from the end.
If I run the same program using the alpha development driver (version 3.1.1), I'm missing 4 characters from the start, and 4 null characters are appended to the end.
I have mysql server 4.0.12 on Redhat Linux 9.0 (2.6 kernel) , i386
program is: NOTE: DbManager is just a wrapper for a Connection object.
import java.io.BufferedReader; import java.io.FileOutputStream; import java.io.PrintStream; import java.sql.Clob; import java.sql.ResultSet;
public class FetchFromDb {
public static void main(String[] args) throws Exception { PrintStream out = new PrintStream(new FileOutputStream("out.xml")); DbManager manager = new DbManager("com.mysql.jdbc.Driver",
"jdbc:mysql://localhost/BINDSubmit?user=username_goes_here&password=password _goes_here&autoReconnect=true");
manager.connect();
ResultSet rs = manager.executeQuery("select XMLRecord from BINDSubmit"); rs.first(); Clob clob = rs.getClob("XMLRecord");
BufferedReader reader = new BufferedReader(clob.getCharacterStream()); String line = null; while( (line = reader.readLine()) != null) { out.println(line); } out.flush();
rs.close(); manager.disconnect(); }
You can get the mysqldump of the row @ ftp://ftp.blueprint.org/mysql BINDSubmit.mysqldump.gz (about 0.4MB )
I'd appreciate any help or insight on this problem.
Thanks in advance, Marc
-- Marc Dumontier Bioinformatics Software Developer The Blueprint Initiative - North America 522 University Ave. Toronto, Ontario, Canada M5G 1W7 http://www.blueprint.org
-- MySQL Java Mailing List For list archives: http://lists.mysql.com/java To unsubscribe: http://lists.mysql.com/java?unsub=mrdu...@blueprint.org




