Forums Register Login

database is locked when i try to add to table.

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
Your JDBC code looks fine. I'm going to move this to our Swing forum to see if anyone there knows.
+Pie Number of slices to send: Send
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.
You'll never get away with this you overconfident blob! The most you will ever get is this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 826 times.
Similar Threads
Remove JPanel Components
JPanels with different content should have the same size
Two Input Dialogs in the Same Window?
Layout question
Help with actionlisteners on a button.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:40:14.