Jdbc driver bug

This is a discussion on Jdbc driver bug within the MySQL Database forums, part of the Database Forums category; Hi, When trying to commit an insert from a java app, I get a NullPointerException The data is saved correctly ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-07-2008
1 connu
 
Posts: n/a
Default Jdbc driver bug

Hi,

When trying to commit an insert from a java app, I get a
NullPointerException
The data is saved correctly in the database !

Thanks in advance for any help.
Pierre

Trace :
INFO QueryLogger: INSERT INTO documentComite (dateCreation, isPublie,
membreId, nomFichier, titre, url) VALUES (?, ?, ?,
?, ?, ?)
INFO QueryLogger: [bind: '2008-03-07 03:30:40.913', NULL, 60,
'optionMembres.PNG', 'Choose title',
'/Pharmaco/FichierComite/optionMembres.PNG']
INFO QueryLogger: *** error.
java.lang.NullPointerException
at com.mysql.jdbc.Field.getMaxBytesPerCharacter(Field .java:259)
at
com.mysql.jdbc.ResultSetMetaData.getColumnDisplayS ize(ResultSetMetaData.java:331)
at
org.apache.cayenne.access.jdbc.ColumnDescriptor.(C olumnDescriptor.java:156)



Reply With Quote
  #2 (permalink)  
Old 03-07-2008
lark
 
Posts: n/a
Default Re: Jdbc driver bug

1 connu wrote:
> Hi,
>
> When trying to commit an insert from a java app, I get a
> NullPointerException
> The data is saved correctly in the database !
>
> Thanks in advance for any help.
> Pierre
>
> Trace :
> INFO QueryLogger: INSERT INTO documentComite (dateCreation, isPublie,
> membreId, nomFichier, titre, url) VALUES (?, ?, ?,
> ?, ?, ?)
> INFO QueryLogger: [bind: '2008-03-07 03:30:40.913', NULL, 60,
> 'optionMembres.PNG', 'Choose title',
> '/Pharmaco/FichierComite/optionMembres.PNG']
> INFO QueryLogger: *** error.
> java.lang.NullPointerException
> at com.mysql.jdbc.Field.getMaxBytesPerCharacter(Field .java:259)
> at
> com.mysql.jdbc.ResultSetMetaData.getColumnDisplayS ize(ResultSetMetaData.java:331)
> at
> org.apache.cayenne.access.jdbc.ColumnDescriptor.(C olumnDescriptor.java:156)
>
>
>

looks like you're trying to insert null in a feild that doesn't take null.
Reply With Quote
  #3 (permalink)  
Old 03-08-2008
ThanksButNo
 
Posts: n/a
Default Re: Jdbc driver bug

On Mar 7, 10:56 am, lark <ham...@sbcglobal.net> wrote:
> 1 connu wrote:
> > Hi,

>
> > When trying to commit an insert from a java app, I get a
> > NullPointerException
> > The data is saved correctly in the database !

>
> > Thanks in advance for any help.
> > Pierre

>
> > Trace :
> > INFO QueryLogger: INSERT INTO documentComite (dateCreation, isPublie,
> > membreId, nomFichier, titre, url) VALUES (?, ?, ?,
> > ?, ?, ?)
> > INFO QueryLogger: [bind: '2008-03-07 03:30:40.913', NULL, 60,
> > 'optionMembres.PNG', 'Choose title',
> > '/Pharmaco/FichierComite/optionMembres.PNG']
> > INFO QueryLogger: *** error.
> > java.lang.NullPointerException
> > at com.mysql.jdbc.Field.getMaxBytesPerCharacter(Field .java:259)
> > at
> > com.mysql.jdbc.ResultSetMetaData.getColumnDisplayS ize(ResultSetMetaData.java:331)
> > at
> > org.apache.cayenne.access.jdbc.ColumnDescriptor.(C olumnDescriptor.java:156)

>
> looks like you're trying to insert null in a feild that doesn't take null.


I would double-check the Java code that does the insert.

I would expect that trying to insert a null value into a column that
doesn't take null should generate a Database error, not a Java
NullPointerException. Plus, it should reject the entire insert
attempt.

There might be a bug in the driver, but I'd recommend going through
your own code with a fine-tooth comb.
Reply With Quote
  #4 (permalink)  
Old 03-09-2008
1 connu
 
Posts: n/a
Default Re: Jdbc driver bug

Thanks for your help.

Look like it's a bug from Tomcat.
If the jar of my appli are in the shared/lib, I get the exception.
If packaged with my app, mo problem !!



"ThanksButNo" <no.no.thanks@gmail.com> a écrit dans le message de news:
4243afbe-c3ca-4bcb-b952-499e9364cdb3...oglegroups.com...
> On Mar 7, 10:56 am, lark <ham...@sbcglobal.net> wrote:
>> 1 connu wrote:
>> > Hi,

>>
>> > When trying to commit an insert from a java app, I get a
>> > NullPointerException
>> > The data is saved correctly in the database !

>>
>> > Thanks in advance for any help.
>> > Pierre

>>
>> > Trace :
>> > INFO QueryLogger: INSERT INTO documentComite (dateCreation, isPublie,
>> > membreId, nomFichier, titre, url) VALUES (?, ?, ?,
>> > ?, ?, ?)
>> > INFO QueryLogger: [bind: '2008-03-07 03:30:40.913', NULL, 60,
>> > 'optionMembres.PNG', 'Choose title',
>> > '/Pharmaco/FichierComite/optionMembres.PNG']
>> > INFO QueryLogger: *** error.
>> > java.lang.NullPointerException
>> > at com.mysql.jdbc.Field.getMaxBytesPerCharacter(Field .java:259)
>> > at
>> > com.mysql.jdbc.ResultSetMetaData.getColumnDisplayS ize(ResultSetMetaData.java:331)
>> > at
>> > org.apache.cayenne.access.jdbc.ColumnDescriptor.(C olumnDescriptor.java:156)

>>
>> looks like you're trying to insert null in a feild that doesn't take
>> null.

>
> I would double-check the Java code that does the insert.
>
> I would expect that trying to insert a null value into a column that
> doesn't take null should generate a Database error, not a Java
> NullPointerException. Plus, it should reject the entire insert
> attempt.
>
> There might be a bug in the driver, but I'd recommend going through
> your own code with a fine-tooth comb.



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:13 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0