Ask Your Question

How to convert unknown datatype to string in JDBC client

asked 2018-04-12 08:22:19 -0500

mstang gravatar image

This is actually related to my question about DECFLOATS in DB2.

In that case casting works for us, but we'd prefer to use SELECT * . I've tried the advanced option: On Unknown Type - Convert to String but this generates java.lang.NullPointerException

Should this work, or am I misunderstanding it's use?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-04-22 13:06:50 -0500

mstang gravatar image

I was attempting this on version 2.7.0, I upgraded to 3.1.3 and this issue is fixed.

edit flag offensive delete link more

answered 2018-04-12 15:48:05 -0500

jeff gravatar image

Can you capture the full stack trace for the NullPointerException? The behavior for converting to String should work if the JDBC driver itself implements this method correctly for the object they return for the column (see here). Unfortunately, as there are a myriad of JDBC drivers from different vendors, it's entirely possible that for the specific driver you are using, that is not the case. Feel free to open a Jira with as much detail as you can provide (table DDL, exact driver jar and version, etc.) and we can investigate.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-04-12 08:22:19 -0500

Seen: 310 times

Last updated: Apr 22 '18