NetBeans Project: Part-07 | Employee Management System
Solution for the database locked problem
When you are going to run one file, the action button is going to do two thing together. That is the main reason for the error. So we have to close the other execution which has going to happen after we click on the login button.
In our Netbeans project, both Login_jframe.java and Employee_info.java files are running separately without any problem. But you are going to run the project java.sql.SQLException error will come as database is locked. To solve this problem just simple command has to be added to the java files. When you are going to run one file, the action button is going to do two thing together. That is the main reason for the error. So we have to close the other execution which has going to happen after we click on the login button.
After every catch inside the java files, you have to add these code. It will solve the problem. Netbeans supports you to find 'catch' clauses in the file. However, at here you have to add this codes only inside to the methods that you have already created in previous java files.
Highlight the 'catch' then go to the file menu and click Edit --> File Selection. Then you canfind the next 'catch' clause by fressing F3 button. Thus add the codes as shown in the figure and make sure to changes will happen only in your methods that you have created. After adding these codes into both Login_jframe.java and Employee_info.java, still you don't have the facility to run whole project. Go to the Login_jframe.java file and make these changes.
Now you ready to run the project. If you want to download full code, please click on the files to download them into your computer. Login_jframe.java | Employee_info.java
In next part we will discuss about ‘how to close previous jFrame after opening of a new jFrame’ by using Java. If you have any doubts about the part – 07 please don’t hesitate to ask from iTech Digest | Thank you! See you on part - 08
Post a Comment