https://downloads.mariadb.org/connector-java/
Properties > Java Build Path > Libraries탭의 Add External JARs... > 다운받은 파일 선택
Deployment Assembly > Add > Java Build Path Entries > connector j 선택
String sql = "";
String url = "jdbc:mariadb://localhost:3306/db이름";
String uid = "myId";
String upw = "myPassword"
Connection conn = null;
try {
Class.forName("org.mariadb.jdbc.Driver");
conn = DriverManager.getConnection(url, uid, upw);
System.out.println("db연결 성공!");
}catch(ClassNotFoundException e){
e.printStackTrace();
}catch(SQLException e){
e.printStackTrace();
}
간단하게 확인
"db연결 성공!" 출력하면 성공적으로 연결된거