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.4.0</version>
</dependency>
Latest posts by Wayan (see all)
- How do I use Proxy class to configure HTTP and SOCKS proxies in Java? - March 27, 2025
- How do I retrieve network interface information using NetworkInterface in Java? - March 26, 2025
- How do I work with InetAddress to resolve IP addresses in Java? - March 25, 2025