[libreoffice-users] Re: Fwd: Re: Value '0000-00-00' can not be represented as java.sql.Date

2012-12-17 Thread Alex Thurgood
Le 16/12/2012 02:49, receiver a écrit :


Hi receiver,

It is MySQL's choice to have allowed '-00-00' as the representation
of an invalid date string. Previous versions of the JDBC connector could
handle these strings. When the connector J development moved to 5.x,
MySQL had to introduce an option to the driver to deal with them.


Alex



-- 
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Re: Fwd: Re: Value '0000-00-00' can not be represented as java.sql.Date

2012-12-16 Thread NoOp
On 12/15/2012 05:49 PM, receiver wrote:
> Yes, that was something that naturally came to mind so I did try it and 
> it does solve the problem of the zero valued date.  However, my 
> objective is to develop a database file (i.e., .odb) that I can send to 
> a community of users who may lack the technical savvy to wrestle with 
> prerequisite setup requirements.  In this sense ODBC is a bit of a 
> beast.  It seems to rely on something that Windows refers to as data 
> sources which are external to the .odb file.  There are lots of options 
> which would make one think that it should be possible to invest in some 
> extra work when creating the .odb file that makes life simpler for the 
> technically challenged community of users. However, I wasn't able to 
> achieve such a result.  In fact it appears as though LibreOffice Base 
> does not even allow the use of what Windows calls the file type of data 
> source.
> 
> Both ODBC and JDBC require my users to have connectors installed.  I 
> haven't yet determined that JDBC is good enough to solve the problem, of 
> having my users know about server connections, but it does look like 
> more of the database (i.e., MySQL server) connection specific setup is 
> confined to the .odb file.  This is why I'd like to make JDBC work.  
> Insofar as zero valued dates seem to be quite natural for a MySQL 
> database one would think that the MySQL supplied Connector J could deal 
> with such more elegantly.
> 
> David ...
...

...

This works for me:


May be of interest as your error isn't just a Base problem
:




 With the connection string option noDatetimeStringSync set to true, and
server-side prepared statements enabled, the following exception was
generated if an attempt was made to obtain, using ResultSet.getString(),
a datetime value containing all zero components:

java.sql.SQLException: Value '-00-00' can not be represented as
java.sql.Date

(Bug #32525)