package org.kodejava.jdbc;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
public class JDBCCompliant {
private static final String URL = "jdbc:mysql://localhost/kodejava";
public static void main(String[] args) {
try {
Driver driver = DriverManager.getDriver(URL);
// Check if the driver is a genuine JDBC compliant driver.
if (driver.jdbcCompliant()) {
System.out.println("A genuine JDBC compliant driver");
} else {
System.out.println("Not a genuine JDBC compliant driver");
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
Maven Dependencies
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.1.0</version>
</dependency>
Latest posts by Wayan (see all)
- How do I create a string of repeated characters? - September 1, 2023
- How do I convert datetime string with optional part to a date object? - August 28, 2023
- How do I split large excel file into multiple smaller files? - April 15, 2023