package databaseproject; import java.sql.Connection; import java.sql.DriverManager; public class DB_Connector { public static void main(String[] args) throws Exception { DB_Connector obj_DB_connection = new DB_Connector(); // System.out.println(obj_DB_connection.get_connection()); } public static Connection get_connection() throws Exception { Connection connection = null; try { Class.forName("com.mysql.jdbc.Driver"); // connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/mobilesystem?user=root&password=root4231"); connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/mobilesystem?useLegacyDatetimeCode=true&serverTimezone=UTC&useSSL=false", "root", "root4231"); } catch (Exception e) { e.printStackTrace(); } return connection; } }