Thursday, October 25, 2012

Code used in video "Java prog#7. Database is locked problem solution in Java Netbeans and Sqlite (mysql)"

HERE I AM PROVIDING THE downloadable CODE LINK OF  THE JAVA CODE I HAVE USED IN THE VIDEO  "Java prog#7. Database is locked problem solution in Java Netbeans and Sqlite (mysql)"  OF MY YOUTUBE CHANNEL PROGRAMMINGKNOWLEDGE

Click Link to watch the video LINK

This code below is for the example of method action perform



   
 private void Fillcombo(){   

try{
  String sql="select * from Empoyeeinfo";
  pst=conn.prepareStatement(sql);
   rs=pst.executeQuery();
   
   while(rs.next()){
   String name =rs.getString("name");
   ComboBox_name.addItem(name);
   
   }

}catch(Exception e){

JOptionPane.showMessageDialog(null, e);

} 
///This is the main code for the  block DATABASE IS LOCKED PROBLEM SOLUTION
finally {
try{
  rs.close();
      pst.close();
    // conn.close();
  }
  catch(Exception e) {
                   }
      } 


}


Java prog#7. Database is locked problem solution in Java Netbeans and Sqlite (mysql)





Jave Netbeans and Sqlite (mysql) Database is locked problem solution.
Just paste the code-block after every try catch block

 finally {
try{
  rs.close();
      pst.close();
    
  }
  catch(Exception e) {
                   }
      }




The SQLite wiki DatabaseIsLocked page offers a good explanation of this error message. It states, in part, that the source of contention is internal (to the process emitting the error).

http://www.sqlite.org/cvstrac/wiki?p=DatabaseIsLocked

What this page doesn't explain is how SQLite decides that something in your process holds a lock and what conditions could lead to a false positive.

[Solved] sqlite database lock problem
Sqlite locking problem
Sqlite: Database is Locked error and unlocking the database
 "Database is locked" problem with sqlite
iit Learn     java netbeans
java tutorial netbeans

No comments:

Post a Comment