Thread: Jdbc driver bug
View Single Post

   
  #3 (permalink)  
Old 03-09-2008, 01:37 PM
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