Problems using newer JDBC drivers with MySQL

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

llyr
Ebase User
Posts: 7
Joined: Fri Dec 17, 2010 2:34 pm

Problems using newer JDBC drivers with MySQL

#1

Postby llyr » Mon Dec 20, 2010 10:34 am

Hope someone can help!

We have recently upgraded our JDBC driver in our development environment to version 5.1.10 but have been experiencing problems as a result. In addition, our ebase development environment has forms facing off to MySQL databases on two different servers. One server is MySQL 5.0.33 and the other is 5.1.48. We are only experiencing these issues on version 5.0.33.

The error we are getting is whilst we are running a form and we are using any functions in queries such as TIME_FORMAT or DATE_FORMAT we get an error saying:-

* Unable to set value for field TBLREPORTS2-DESCRIPTION, value [B@149b1dd not compatible with type CHAR *

Anyone with any ideas please?

Thanks,
Llyr
0 x

llyr
Ebase User
Posts: 7
Joined: Fri Dec 17, 2010 2:34 pm

#2

Postby llyr » Tue Jan 11, 2011 9:35 am

Surely someone must have had a similar issue??
0 x

Vircos
Ebase User
Posts: 97
Joined: Thu Sep 13, 2007 6:07 am
Location: The Netherlands

Re: Problems using newer JDBC drivers with MySQL

#3

Postby Vircos » Tue Jan 11, 2011 1:38 pm

llyr wrote:Hope someone can help!
...
we are using any functions in queries such as TIME_FORMAT or DATE_FORMAT
...
Perhaps those functions are not supported by later versions of MySQL. We have faced similar problems with MS SQL Server 2000 and 2005 because of this.
0 x
What's the meaning of Justice...

llyr
Ebase User
Posts: 7
Joined: Fri Dec 17, 2010 2:34 pm

Re: Problems using newer JDBC drivers with MySQL

#4

Postby llyr » Mon Jan 17, 2011 9:59 am

Vircos wrote:Perhaps those functions are not supported by later versions of MySQL. We have faced similar problems with MS SQL Server 2000 and 2005 because of this.
But these functions work fine with both MySQL 5.0.33 and 5.1.48 using the current JDBC version in live which is 3.0.15. It's only when we've upgraded to JDBC version 5.1.10 that these functions then stop working in MYSQL 5.0.33.

Anyone with any ideas please?
0 x

Vircos
Ebase User
Posts: 97
Joined: Thu Sep 13, 2007 6:07 am
Location: The Netherlands

#5

Postby Vircos » Tue Jan 18, 2011 9:15 am

I think I do understand your problem now.

Within your form you use a table with a field named "TBLREPORTS2-DESCRIPTION". I assume that this field is a date field, correct?

If I do understand the documentation of MySQL correctly the TIME_FORMAT and DATE_FORMAT functions both returns a string.

So, if my assumption is right, you are trying to put a string into a date field and that will generate the error mentioned by you.

If you change the field "TBLREPORTS2-DESCRIPTION" from Date to Character your problem should be solved.
0 x
What's the meaning of Justice...

llyr
Ebase User
Posts: 7
Joined: Fri Dec 17, 2010 2:34 pm

#6

Postby llyr » Tue Jan 18, 2011 9:58 am

Vircos wrote:I think I do understand your problem now.

Within your form you use a table with a field named "TBLREPORTS2-DESCRIPTION". I assume that this field is a date field, correct?

If I do understand the documentation of MySQL correctly the TIME_FORMAT and DATE_FORMAT functions both returns a string.

So, if my assumption is right, you are trying to put a string into a date field and that will generate the error mentioned by you.

If you change the field "TBLREPORTS2-DESCRIPTION" from Date to Character your problem should be solved.
No, TBLREPORTS2-DESCRIPTION is a Char.

These forms have been working fine in live using JDBC version 3.0.15. It's since we've upgraded the JDBC drivers to 5.1.10 we've had these errors
0 x

AJDulk
Ebase User
Posts: 94
Joined: Fri Sep 14, 2007 12:18 pm
Location: The Netherlands
Contact:

#7

Postby AJDulk » Wed Jan 19, 2011 1:08 pm

llyr wrote:These forms have been working fine in live using JDBC version 3.0.15. It's since we've upgraded the JDBC drivers to 5.1.10 we've had these errors
Maybe a silly question but, if the old JDBC drivers work and the new not, why do the upgrade?
0 x

llyr
Ebase User
Posts: 7
Joined: Fri Dec 17, 2010 2:34 pm

#8

Postby llyr » Mon Jan 31, 2011 10:09 am

Because we need to be able to execute stored procedures in MySQL. Can only do this with newer JDBC drivers....
0 x

ehmd
Ebase User
Posts: 53
Joined: Thu Sep 13, 2007 9:02 am
Contact:

#9

Postby ehmd » Mon Jan 31, 2011 11:07 am

There appears to have been some changes introduced in Mysql 5.1 which may affect the DATE_FORMAT function and may produce different results to the 5.0 version.

These are documented at http://dev.mysql.com/doc/refman/5.1/en/ ... pport.html

Have you tried the 5.0.x version of the JDBC driver which is available from here ?

http://dev.mysql.com/downloads/connecto ... #downloads

This might resolve your problem for the 5.0.x issues but introduce problems in 5.1.

It's a while since I used Mysql in earnest but I would guess that there is some configuration discrepancy between the 5.0.x and 5.1.x in the storage and formatting of dates.
0 x


Who is online

Users browsing this forum: No registered users and 128 guests