Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- java.lang.Error: Unresolved compilation problem: The method insertSprint(String, Date, Date, long, int) in the type MySQL is not applicable for the arguments (String, Date, Date, long, int)
- public static void insertSprint(String name, java.sql.Date start, java.sql.Date end,long duration, int proj_ID){
- Connection con=null;
- PreparedStatement pstmt = null;
- try{
- Class.forName("com.mysql.jdbc.Driver");
- con=DriverManager.getConnection("jdbc:mysql://localhost:3306/Collabsoft","root","");
- String query ="Insert into sprints (Title,Start_Date,End_Date,Duration,Proj_ID) values (?,?,?,?,?)";
- pstmt = (PreparedStatement) con.prepareStatement(query);
- pstmt.setString(1, name); // set input parameter 1
- pstmt.setDate(2, start); // set input parameter 2
- pstmt.setDate(3, end);
- pstmt.setLong(4, duration); // set input parameter 3
- pstmt.setInt(5, proj_ID);
- pstmt.executeUpdate();
- }
- protected void onSubmit()
- {
- String s_Name=(String)sprint.getObject();
- Date s_Date=(Date)start_Date.getObject();
- Date e_Date=(Date)end_Date.getObject();
- long diff = e_Date.getTime()-s_Date.getTime();
- long days = diff/(1000 * 60 * 60 * 24);
- int proj_id=1;
- if(s_Name!=null && s_Date!=null && e_Date!=null)
- {
- MySQL.insertSprint(s_Name, s_Date, e_Date, days, proj_id);
- SprintResult sprintResult = new SprintResult(s_Name,days);
- setResponsePage(sprintResult);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement