-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconn.java
More file actions
30 lines (22 loc) · 746 Bytes
/
Copy pathconn.java
File metadata and controls
30 lines (22 loc) · 746 Bytes
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
package employee.management.stystem;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class conn {
Connection connection;
Statement statement;
public conn(){
try{
Class.forName("com.mysql.cj.jdbc.Driver");
connection = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/employeemanagement?useSSL=false&serverTimezone=UTC",
"root",
"Shruti123"
);
statement = connection.createStatement();
System.out.println("Connected Successfully ✅");
}catch (Exception e){
e.printStackTrace();
}
}
}