Results 1 to 2 of 2
  1. #1
    bikkerss is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

    Default storing jcheckbox value to database sqllite

    hi

    i'm trying to store a value from a jcheckbox to an sqllite database
    i have use the isselected option to save it, this works and the value is writen to the database.

    but i want also to go to the next and previouse record there for a use the isselected option with a database reader

    dbfile=new File("inforegistratie.db3");
    db=SqlJetDb.open(dbfile, true);
    ISqlJetTable sqltabel=db.getTable("table");
    db.beginTransaction(SqlJetTransactionMode.READ_ONL Y);
    ISqlJetCursor r=sqltabel.open();

    checkbox.setSelected(r.getBoolean(26));

    but i get the following error (database type of the kolom is boolean)




    run:
    Exception in thread "AWT-EventQueue-0" java.lang.Error: java.lang.reflect.InvocationTargetException
    at org.jdesktop.application.ApplicationAction.actionF ailed(ApplicationAction.java:859)
    at org.jdesktop.application.ApplicationAction.noProxy ActionPerformed(ApplicationAction.java:665)
    at org.jdesktop.application.ApplicationAction.actionP erformed(ApplicationAction.java:698)
    at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:236)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEven tMulticaster.java:272)
    at java.awt.Component.processMouseEvent(Component.jav a:6263)
    at javax.swing.JComponent.processMouseEvent(JComponen t.java:3267)
    at java.awt.Component.processEvent(Component.java:602 8)
    at java.awt.Container.processEvent(Container.java:204 1)
    at java.awt.Component.dispatchEventImpl(Component.jav a:4630)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2099)
    at java.awt.Component.dispatchEvent(Component.java:44 60)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2478 )
    at java.awt.Component.dispatchEvent(Component.java:44 60)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 599)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:122)
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jdesktop.application.ApplicationAction.noProxy ActionPerformed(ApplicationAction.java:662)
    ... 27 more
    Caused by: java.lang.NumberFormatException: For input string: "false"
    at java.lang.NumberFormatException.forInputString(Num berFormatException.java:48)
    at java.lang.Long.parseLong(Long.java:410)
    at java.lang.Long.valueOf(Long.java:525)
    at org.tmatesoft.sqljet.core.internal.SqlJetUtility.a toi64(SqlJetUtility.java:919)
    at org.tmatesoft.sqljet.core.internal.vdbe.SqlJetVdbe Mem.intValue(SqlJetVdbeMem.java:703)
    at org.tmatesoft.sqljet.core.internal.table.SqlJetBtr eeTable.getInteger(SqlJetBtreeTable.java:347)
    at org.tmatesoft.sqljet.core.internal.table.SqlJetBtr eeDataTable.getInteger(SqlJetBtreeDataTable.java:8 68)
    at org.tmatesoft.sqljet.core.internal.table.SqlJetCur sor$16.run(SqlJetCursor.java:183)
    at org.tmatesoft.sqljet.core.table.SqlJetDb$6.runWith Lock(SqlJetDb.java:392)
    at org.tmatesoft.sqljet.core.table.SqlJetDb.runWithLo ck(SqlJetDb.java:298)
    at org.tmatesoft.sqljet.core.table.SqlJetDb.runTransa ction(SqlJetDb.java:386)
    at org.tmatesoft.sqljet.core.table.SqlJetDb.runReadTr ansaction(SqlJetDb.java:372)
    at org.tmatesoft.sqljet.core.internal.table.SqlJetCur sor.getBoolean

  2. #2
    bikkerss is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

Similar Threads

  1. How can I add JCheckBox to each row?
    By batya in forum AWT / Swing
    Replies: 1
    Last Post: 11-04-2009, 10:25 PM
  2. Storing video files in mysql database
    By mrvigneshmca in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-27-2009, 04:50 PM
  3. Storing image loaded in applet in mysql database
    By mrvigneshmca in forum Java Applets
    Replies: 1
    Last Post: 03-20-2009, 05:17 PM
  4. Replies: 10
    Last Post: 12-23-2008, 08:37 PM
  5. storing exel data to access database
    By sijokunnappilly in forum Advanced Java
    Replies: 1
    Last Post: 10-30-2008, 08:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •