Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6662797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:25:44+00:00 2026-05-26T02:25:44+00:00

It hasn’t been too much trouble but there’s an error I keep getting from

  • 0

It hasn’t been too much trouble but there’s an error I keep getting from an update from user clicking a button.

Originally in MySQL this was an enum(‘Y’,’N’) value, but as SQLite doesnt use enums or booleans, I’ve decided to use an int with 1 and 0 respectively.

How can this be solved?

if(e.getSource()==boughtB){
    String cigName;
    cigName = Habanos2.selection;
    String humiString;
    int humino;

    Connection con = null;
    System.out.println(cigName);

    try{
        ResultSet humiRS1 = HabMenu.getGenericRS("select * from cigar where name = '"+cigName+"'"); 
        if(humiRS1.next()){
            humiString = humiRS1.getString("humi_no");

            humino = Integer.parseInt(humiString);
            System.out.println("humino"+humino);

            Class.forName("org.sqlite.JDBC").newInstance();

            con = DriverManager.getConnection("jdbc:sqlite:cigardb.db");
            Statement s = con.createStatement();
            humino++;
            String humiNoS = Integer.toString(humino);
            s.executeUpdate("update cigar set humi = 1 where name ='"+cigName+"'" );
            s.executeUpdate("update cigar set humi_no = "+humiNoS+"where name ='"+cigName+"'");

            Habanos2Frame.myHumi.setText("");
            ResultSet humiii = HabMenu.getGenericRS("select * from cigar where humi = 1");

It produces this error:

java.sql.SQLException: database locked
at org.sqlite.DB.execute(DB.java:270)
at org.sqlite.DB.executeUpdate(DB.java:281)
mysql humi error humiNoS =
at org.sqlite.Stmt.executeUpdate(Stmt.java:103)
at cigarDiary.buttonBar$ButtonHandler.actionPerformed(buttonBar.java:207)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:25:45+00:00Added an answer on May 26, 2026 at 2:25 am

    Ok the way I solved this was by closing each ResultSet (rs.close) and Connection (con.close) after I was finished using it. This is something that MySql doesnt seem to mind but SQLite does. It wont allow you to perform an update while a resultset and its connection are stilll open.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been wondering this for a while but since it hasn't come up much
There's no way this question hasn't been asked before but I cannot find a
This is discussed in this thread but it looks like it hasn't been documented
Apologies if this is a simple question but googling hasn't been able to help
I hope that this question hasn't been asked already, but I was looking for
hoping this hasn't been asked before, but I have the following XML: <Company id=1000
I'm shocked that this hasn't been asked yet - but I can't install VS
I hope this hasn't been asked and I just missed it, but I searched
I'm having difficulties believing this question hasn't been asked before, but I couldn't find
I'm trying to redirect the user if their account hasn't been confirmed. So this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.