• Post Reply Bookmark Topic Watch Topic
  • New Topic

database is locked when i try to add to table.

 
Derek Rose
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a class that adds some user input to my database. i have many other classes that add to the DB and this one is nothing special. i have a very small swing application that i use to test to make sure the entries are stored properly and the code for the database works. However in my actual program the input is put into a JFrame that displays when a button is pushed(setVisible(true) when button is pushed. the Class name is OptionFrame. If i try to setVisible directly to OptionFrame is says non static method setVisible cannot be accessed from static content. So i instantiate my own static version of the frame and set that Visible to true. So the window pops up, when i press enter it says database locked rather than entering the information. Like i said, i tested the database code without the pop up frame and it works...why am i having this issue. Here is the code for the class...

Here is the code for the instantiation and the action event

Here is the code to insert into databse, as ive said before though i know that this code works outside of this OptionFrame.
 
Derek Rose
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I've narrowed down my problem...maybe that will help encourage some responses. The button and labels are set to enabled(false) until a password is entered. If I set it the default value to true all is fine. The value is set to true once the password is entered. Anyone know why this is?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35728
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your JDBC code looks fine. I'm going to move this to our Swing forum to see if anyone there knows.
 
Derek Rose
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thank you. Ive narrowed down the problem even further to the JPasswordField. I had the code working fine until I add in the dialog box asking for the password. If the password equals the string stored in the password database then it is supposed to run the method that inserts the data into the database table. Once that dialog box is in place it gives me the "database is locked" error. There is no actual password on the data base. I just want this one method to be limited access.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!