public void addBookDetails(String name, String author, String publisher, int year, int price){ Connection conn=null; DBConnection DBConn=new DBConnection(); try { conn=DBConnection.createConnection(); Statement statement=conn.createStatement(); System.out.println("INSERT INTO Books " + "VALUES ('"+name+"', '"+author+"', '"+publisher+"', '"+year+"', '"+price+"')"); statement.executeUpdate("INSERT INTO Books " + "VALUES ('"+name+"', '"+author+"', '"+publisher+"', '"+year+"', '"+price+"')"); DBConn.closeConnection(); } catch (SQLException e) { e.printStackTrace(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)