-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathleaverequest.java
62 lines (38 loc) · 1.38 KB
/
leaverequest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package sample;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.DatePicker;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import java.sql.*;
import java.time.LocalDate;
public class leaverequest {
@FXML
private DatePicker from;
@FXML
private DatePicker to;
@FXML
private TextField reason;
@FXML
private Button submitbtn;
@FXML
private Label label;
@FXML
void submit(ActionEvent event) throws Exception {
ConnectionClass connectionClass=new ConnectionClass();
Connection connection=connectionClass.getConnection();
Statement statement=connection.createStatement();
// LocalDate lb1=from.getValue();
//String lb2=((TextField)to.getEditor()).getText();
//System.out.println(lb1);
String sql="insert into leave"+"(`user`, `from`, `to`, `reason`)"+"values(?,?,?,?)";
PreparedStatement preparedStatement=connection.prepareStatement(sql);
preparedStatement.setString(1,"asd");
preparedStatement.setString(2,"asd");
preparedStatement.setString(3,"asd");
preparedStatement.setString(4,"asd");
preparedStatement.executeUpdate();
//statement.executeUpdate(sql);
}
}