Book Publication System
Book Publication System
Editor Details
try { Class.forName("com.mysql.jdbc.Driver"); Connection c = DriverManager.getConnection("jdbc:mysql://localhost:3306/bookpublication","root",""); Statement s= c.createStatement(); s.executeUpdate("DELETE FROM editordetails WHERE EditorID='"+txtEditorID.getText()+"'"); } catch (SQLException ex) { Logger.getLogger(AuthorDeatils.class.getName()).log(Level.SEVERE, null, ex); } catch (ClassNotFoundException ex) { Logger.getLogger(AuthorDeatils.class.getName()).log(Level.SEVERE, null, ex); } }
Book Details
s.executeUpdate("INSERT INTO bookdetails VALUES('"+txtBookID.getText()+"','"+txtBookName.getText()+"','"+txtAuthorID.getText()+"','"+txtEditorI D.getText()+"','"+cmbBookCategory.getSelectedItem().toString()+"','"+cmbField.getSelectedItem().toStri ng()+"','"+txtCopiesAvalable.getText()+"')"); } catch (SQLException ex) { Logger.getLogger(AuthorDeatils.class.getName()).log(Level.SEVERE, null, ex); } catch (ClassNotFoundException ex) { Logger.getLogger(AuthorDeatils.class.getName()).log(Level.SEVERE, null, ex); } }
s.executeUpdate("UPDATE bookdetails SET BookName = '"+txtBookName.getText()+"', AuthorID = '"+txtAuthorID.getText()+"',EditorID = '"+txtEditorID.getText()+"', BookCategory = '"+cmbBookCategory.getSelectedItem().toString()+"', Field = '"+cmbField.getSelectedItem().toString()+"', CopiesAvailable = '"+txtCopiesAvalable.getText()+"' WHERE BookID='"+txtBookID.getText()+"'"); } catch (SQLException ex) { Logger.getLogger(AuthorDeatils.class.getName()).log(Level.SEVERE, null, ex); } catch (ClassNotFoundException ex) { Logger.getLogger(AuthorDeatils.class.getName()).log(Level.SEVERE, null, ex); } }
Outlet Details
s.executeUpdate("INSERT INTO outletdetails VALUES('"+txtOutletID.getText()+"','"+txtOutletName.getText()+"','"+ftxtContactNo.getText()+"','"+txtNo Books.getText()+"')"); } catch (SQLException ex) { Logger.getLogger(AuthorDeatils.class.getName()).log(Level.SEVERE, null, ex); } catch (ClassNotFoundException ex) { Logger.getLogger(AuthorDeatils.class.getName()).log(Level.SEVERE, null, ex); } }
s.executeUpdate("UPDATE outletdetails SET OutletName = '"+txtOutletName.getText()+"', ContactNo = '"+ftxtContactNo.getText()+"', NoofBooks = '"+txtNoBooks.getText()+"' WHERE OutletID='"+txtOutletID.getText()+"'"); } catch (SQLException ex) { Logger.getLogger(AuthorDeatils.class.getName()).log(Level.SEVERE, null, ex); } catch (ClassNotFoundException ex) { Logger.getLogger(AuthorDeatils.class.getName()).log(Level.SEVERE, null, ex); } }
} catch (SQLException ex) { Logger.getLogger(AuthorDeatils.class.getName()).log(Level.SEVERE, null, ex); } catch (ClassNotFoundException ex) { Logger.getLogger(AuthorDeatils.class.getName()).log(Level.SEVERE, null, ex); } }