Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RegisterDAO {
- public static int save(){
- int status = 0;
- try{
- Class.forName("org.postgresql.Driver");
- String url = "jdbc:postgresql://127.0.0.1/mydb1?user=ehill&password=technic";
- Connection con=DriverManager.getConnection(url);
- PreparedStatement ps = con.prepareStatement("insert into helloworld values(?,?,?)");
- ps.setInt(1, 25);
- try{
- Thread.sleep(1500);
- ps.setString(2, "Loopo");
- ps.setString(3, "435");
- }
- catch (Exception e) {
- System.out.println(e);
- NewRelic.noticeError(e.getMessage()); <-------------------------------
- }
- status=ps.executeUpdate();
- }
- catch (Exception e){
- e.printStackTrace();
- NewRelic.noticeError(e.getMessage()); <------------------------
- }
- return status;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement