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 table with multiple header in iText 8? - March 16, 2024
- How do I add Image to a Table in iText 8? - March 11, 2024
- How do I downgrade Android SDK emulator version? - February 12, 2024