Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

long numbers instead of data

Status
Not open for further replies.

garyd1234

Programmer
Sep 11, 2003
3
US
Hi,
I am writing a java servlet. When I run it with ODBC from an access database i can return the data looking great with correct spacing and everything. When i run the same servlet against a mysql database it returns a huge long hexadecimal number. Any ideas why? I can't figure it out.
Thanks.
Gary
 
Well - hm. ODBC is still alive?
No problem.
What else to do access access... ;)

For mysql you use of course a pure jdbc-driver?

How do you get your values from the resultset?
Some code please :)

seeking a job as java-programmer in Berlin:
 
What is the data type in the database ?
What datatype are you extracting via the driver ?

Can you give an example of the data ?



--------------------------------------------------
Free Database Connection Pooling Software
 
FYI,

The original poster seemed to get bored with this thread, and tried his luck in this one instead : thread269-921574

--------------------------------------------------
Free Database Connection Pooling Software
 
Hi,
I have a mysql database set up using blobs for a field type because the data in there is large. When I try to read it back in java using a String field it only gives me part of the information stored in the field. I have tried declaring variables Blob or long var2 = Long.parseLong(var1); but those give errors I don't understand. How can I get the variable to hold the entire contents of the field in the database? Thanks.
 
In your other related post, I suggested you use the ResultSet.getBlob() method.

I still suggest you use that !

See the documentation on Blob :
IE :
ResultSet rs ...
Blob blob = rs.getBlob();
byte[] b = blob.getBytes(1, (int)blob.length());

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top