Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void addModule(String title, String description, String goals, String task, PrintWriter out){
- PreparedStatement ps;
- //name = name;
- // System.out.println("The SQL query is: " + strSelect2);
- // out. println("The SQL query is: " + strSelect2);
- System.out.println();
- out.println();
- try {
- String ins = "insert into module(title,description,goals,task) values(?,?,?,?)";
- ps = conn.prepareStatement(ins);
- ps.setString(1,title);
- ps.setString(2,description);
- ps.setString(3,goals);
- ps.setString(4,task);
- out.println(ps);
- out.println("Er det her det er feil?");
- ps.executeUpdate();
- conn.commit();
- conn.close();
- out.println("Lagt til " +title + " " +description+ " " +goals+ " " +task+ "");
- } // end try // end try
- catch (Exception ex) {
- System.out.println(ex.getCause());
- System.out.println("error");
- out.println("Ikke hentet fra DB " +ex);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement