Importance of issue book library management system.
Library Management device allows in keeping data of books issued to newcomers and books available inside the library. This facilitates librarians to spot any unique e book at any given time inside the library. With the help of barcode, Librarian can preserve song of various records together with: Issue Date.
To get help you can see the video.
Source code for add new student in library page.
- Connect with connection class…
Connection con = null;
ResultSet rs;
PreparedStatement pst;
public New_Student() {
initComponents();
con = Connect.dbConnect();
middle();
}
public void middle(){
setLocationRelativeTo(null);
}
2. Issue book code…
try {
String sql = "select * from book where Book_ID = ? || Name=? ";
pst = con.prepareStatement(sql);
pst.setString(1, jTextField1.getText());
pst.setString(2, jTextField2.getText());
rs = pst.executeQuery();
if (rs.next()) {
String add1 = rs.getString("Book_ID");
jTextField1.setText(add1);
String add2 = rs.getString("Name");
jTextField2.setText(add2);
String add3 = rs.getString("Edition");
jTextField3.setText(add3);
String add4 = rs.getString("Publisher");
jTextField4.setText(add4);
String add5 = rs.getString("Price");
jTextField5.setText(add5);
String add6 = rs.getString("Pages");
jTextField6.setText(add6);
}
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Book Is Not Found");
}
try {
String sql = "select * from student where Student_ID = ? ";
pst = con.prepareStatement(sql);
pst.setString(1, jTextField7.getText());
rs = pst.executeQuery();
if (rs.next()) {
String add1 = rs.getString("Student_ID");
jTextField7.setText(add1);
String add2 = rs.getString("Name");
jTextField8.setText(add2);
String add3 = rs.getString("Father");
jTextField9.setText(add3);
String add4 = rs.getString("Course");
jTextField10.setText(add4);
String add5 = rs.getString("Branch");
jTextField11.setText(add5);
String add6 = rs.getString("Year");
jTextField12.setText(add6);
String add7 = rs.getString("Semester");
jTextField13.setText(add7);
}
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Student Is Not Found");
}
try {
String sql1 = "insert into issue(Book_ID,Name,Edition,Publisher,Price,Pages,Student_ID,SName,FName,Course,Branch,Year,Semester,DateofIssue) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pst = con.prepareStatement(sql1);
pst.setString(1, jTextField1.getText());
pst.setString(2, jTextField2.getText());
pst.setString(3, jTextField3.getText());
pst.setString(4, jTextField4.getText());
pst.setString(5, jTextField5.getText());
pst.setString(6, jTextField6.getText());
pst.setString(7, jTextField7.getText());
pst.setString(8, jTextField8.getText());
pst.setString(9, jTextField9.getText());
pst.setString(10, jTextField10.getText());
pst.setString(11, jTextField11.getText());
pst.setString(12, jTextField12.getText());
pst.setString(13, jTextField13.getText());
pst.setString(14, ((JTextField) jDateChooser1.getDateEditor().getUiComponent()).getText());
pst.execute();
JOptionPane.showMessageDialog(null, "Successfully Inserted...!!!");
} catch (HeadlessException | SQLException e) {
JOptionPane.showMessageDialog(null, e);
}
Be First to Comment