import java.sql.*;
public class TiDBTest {
public static void main(String[] args) {
String dbUrl = "jdbc:mysql://:/?useSSL=false&allowPublicKeyRetrieval=true";
String dbUser = "";
String dbPassword = "";
Connection conn = null;
try {
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection(dbUrl, dbUser, dbPassword);
if (conn != null) {
System.out.println("Connected to TiDB database successfully!");
}
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} finally {
try {
if (conn != null) {
conn.close();
}
} catch (SQLException ex) {
ex.printStackTrace();
}
}
}
}