Java by API/java.sql/Driver — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 14:46, 31 мая 2010
Driver: getMajorVersion()
import java.sql.Driver;
import java.sql.DriverManager;
public class Main {
public static void main(String[] args) throws Exception {
Driver myDriver = new org.hsqldb.jdbcDriver();
DriverManager.registerDriver(myDriver);
System.out.println(myDriver.acceptsURL("jdbc:mydriver://tutorial/"));
System.out.println("Major Version: " +
myDriver.getMajorVersion());
System.out.println("Minor Version: " +
myDriver.getMinorVersion());
System.out.println("JDBC COMPLIANT driver? "
+ myDriver.jdbcCompliant());
}
}
Driver: getMinorVersion()
import java.sql.Driver;
import java.sql.DriverManager;
public class Main {
public static void main(String[] args) throws Exception {
Driver myDriver = new org.hsqldb.jdbcDriver();
DriverManager.registerDriver(myDriver);
System.out.println(myDriver.acceptsURL("jdbc:mydriver://tutorial/"));
System.out.println("Major Version: " +
myDriver.getMajorVersion());
System.out.println("Minor Version: " +
myDriver.getMinorVersion());
System.out.println("JDBC COMPLIANT driver? "
+ myDriver.jdbcCompliant());
}
}
Driver: jdbcCompliant()
import java.sql.Driver;
import java.sql.DriverManager;
public class Main {
public static void main(String[] args) throws Exception {
Driver myDriver = new org.hsqldb.jdbcDriver();
DriverManager.registerDriver(myDriver);
System.out.println(myDriver.acceptsURL("jdbc:mydriver://tutorial/"));
System.out.println("Major Version: " +
myDriver.getMajorVersion());
System.out.println("Minor Version: " +
myDriver.getMinorVersion());
System.out.println("JDBC COMPLIANT driver? "
+ myDriver.jdbcCompliant());
}
}