12357David19 / mdb-sqlite

Automatically exported from code.google.com/p/mdb-sqlite
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

java.sql.SQLException: unexpected param type: class java.lang.Float #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What is the expected output? What do you see instead?

Expected output was a complete converted database. Instead we got this error:

Exception in thread "main" java.sql.SQLException: unexpected param type:
class java.lang.Float
    at org.sqlite.DB.sqlbind(DB.java:211)
    at org.sqlite.DB.execute(DB.java:258)
    at org.sqlite.DB.executeUpdate(DB.java:281)
    at org.sqlite.PrepStmt.executeUpdate(PrepStmt.java:83)
    at com.plausiblelabs.mdb.AccessExporter.populateTable(AccessExporter.java:291)
    at
com.plausiblelabs.mdb.AccessExporter.populateTables(AccessExporter.java:306)
    at com.plausiblelabs.mdb.AccessExporter.export(AccessExporter.java:325)
    at com.plausiblelabs.mdb.Main.main(Main.java:58)

What version of the product are you using? On what operating system?

Product version 1.0.2 patched with patch in Issue 4. On Ubuntu 8.0.4.

Please provide any additional information below.

This problem could be due to an outdated version of sqlitejdbc.

Original issue reported on code.google.com by michael....@gmail.com on 3 Sep 2008 at 7:00

GoogleCodeExporter commented 8 years ago
Problem is not caused due to an outdated version of sqlitejdbc. Recompiled with
latest version (v053). Problem not solved.

Original comment by michael....@gmail.com on 3 Sep 2008 at 7:06

GoogleCodeExporter commented 8 years ago
Problem solved with patch.

Included in that patch are ISSUE 4 and ISSUE 5!

It needed conversion from Float to Double. This has been done through the use of
Double.parseDouble(String number);

Original comment by michael....@gmail.com on 3 Sep 2008 at 7:12

Attachments:

GoogleCodeExporter commented 8 years ago
Changed to type conversion. This should be more precise.

Included in this patch are ISSUE 4 and ISSUE 5!

Original comment by michael....@gmail.com on 3 Sep 2008 at 7:18

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by landon.j.fuller@gmail.com on 25 Sep 2008 at 5:14

GoogleCodeExporter commented 8 years ago
Still getting this problem with the latest version of mdb-sqlite, even with the 
current subversion:

JarClassLoader: Warning: Unable to load native library: 
java.lang.NullPointerException
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.simontuffs.onejar.Boot.run(Boot.java:306)
    at com.simontuffs.onejar.Boot.main(Boot.java:159)
Caused by: java.sql.SQLException: unexpected param type: class java.lang.Float
    at org.sqlite.DB.sqlbind(DB.java:211)
    at org.sqlite.DB.execute(DB.java:258)
    at org.sqlite.DB.executeUpdate(DB.java:281)
    at org.sqlite.PrepStmt.executeUpdate(PrepStmt.java:83)
    at com.plausiblelabs.mdb.AccessExporter.populateTable(Unknown Source)
    at com.plausiblelabs.mdb.AccessExporter.populateTables(Unknown Source)
    at com.plausiblelabs.mdb.AccessExporter.export(Unknown Source)
    at com.plausiblelabs.mdb.Main.main(Unknown Source)
    ... 6 more

Operating system info:

Darwin 9.5.0 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; 
root:xnu-
1228.7.58~1/RELEASE_I386 i386

sqlite version: 3.5.7

It would appear that the above patch has either not been incorporated or is 
needed in other locations in the 
code.

Please advise

Original comment by Kilohoku...@gmail.com on 15 Dec 2008 at 6:32

GoogleCodeExporter commented 8 years ago
Patch has not yet been incorporated. But this is not my project, otherwise I 
would
have done it. You can download the file in the patch and use it instead of the
AccessExporter given with mdb-sqlite.

Original comment by michael....@gmail.com on 15 Dec 2008 at 8:34

GoogleCodeExporter commented 8 years ago
Patch committed in r10. Thanks!

Original comment by landon.j.fuller@gmail.com on 15 Dec 2008 at 8:40

GoogleCodeExporter commented 8 years ago
Issue 4 has been merged into this issue.

Original comment by landon.j.fuller@gmail.com on 15 Dec 2008 at 8:41

GoogleCodeExporter commented 8 years ago
Still getting same error as listed above, after updating to r10 and rebuilding 
(ant clean followed by ant dist).

Original comment by Kilohoku...@gmail.com on 19 Dec 2008 at 5:36

GoogleCodeExporter commented 8 years ago
if not done already...

in the AccessExporter.java, in the "populateTable" method,
change the following line 
<<
case FLOAT:
prep.setDouble(+1, (Double) row.get(column.getName()));
break;
>>

By this one
<<
case FLOAT:
prep.setDouble(i + 1, ( (Float) row.get(column.getName())).doubleValue()       
);
break;
>>

Original comment by gfa.sty...@mls.nc on 12 Oct 2009 at 10:31

GoogleCodeExporter commented 8 years ago
it also works with 

prep.setDouble(i + 1, ( (Float) row.get(column.getName())));

Somebody should add this to trunk

Original comment by gugli...@gmail.com on 21 Oct 2010 at 12:14

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This patch does indeed work but hasn't been committed, and it is now 3 years 
since the last commit.

Can some/one of us get commit access so that these patches can be incorporated 
- as well as the patch which handles relations?

Cheers

Original comment by adjo...@gmail.com on 9 Jan 2011 at 1:46

GoogleCodeExporter commented 8 years ago
Are you up for testing/integrating the proposed patches? If so, please send me 
an e-mail with your info to landonf (at) plausible.coop and I'll add you as a 
committer.

Original comment by landon.j.fuller@gmail.com on 9 Jan 2011 at 2:42