List of usage examples for java.sql Connection close
void close() throws SQLException;
Connection
object's database and JDBC resources immediately instead of waiting for them to be automatically released. From source file:Main.java
public static void main(String[] args) throws Exception { Connection conn = getHSQLConnection(); DatabaseMetaData md = conn.getMetaData(); // Get the list of system functions System.out.println(md.getSystemFunctions()); conn.close(); }
From source file:Main.java
public static void main(String[] args) throws Exception { Connection conn = getHSQLConnection(); DatabaseMetaData md = conn.getMetaData(); // Get the list of system functions System.out.println(md.getStringFunctions()); conn.close(); }
From source file:Main.java
public static void main(String[] args) throws Exception { Connection conn = getHSQLConnection(); DatabaseMetaData md = conn.getMetaData(); System.out.println("supportsMultipleTransactions - " + md.supportsMultipleTransactions()); conn.close(); }
From source file:Main.java
public static void main(String[] args) throws Exception { Connection conn = getHSQLConnection(); DatabaseMetaData md = conn.getMetaData(); System.out.println("supportsMixedCaseIdentifiers - " + md.supportsMixedCaseIdentifiers()); conn.close(); }
From source file:Main.java
public static void main(String[] args) throws Exception { Connection conn = getHSQLConnection(); DatabaseMetaData md = conn.getMetaData(); System.out.println("supportsCorrelatedSubqueries - " + md.supportsCorrelatedSubqueries()); conn.close(); }
From source file:Main.java
public static void main(String[] args) throws Exception { Connection conn = getHSQLConnection(); DatabaseMetaData md = conn.getMetaData(); System.out.println("supportsExpressionsInOrderBy - " + md.supportsExpressionsInOrderBy()); conn.close(); }
From source file:Main.java
public static void main(String[] args) throws Exception { Connection conn = getHSQLConnection(); DatabaseMetaData md = conn.getMetaData(); // Get the list of system functions System.out.println(md.getNumericFunctions()); conn.close(); }
From source file:Main.java
public static void main(String[] args) throws Exception { Connection conn = getHSQLConnection(); DatabaseMetaData md = conn.getMetaData(); System.out.println("supportsANSI92IntermediateSQL - " + md.supportsANSI92IntermediateSQL()); conn.close(); }
From source file:Main.java
public static void main(String[] args) throws Exception { Connection conn = getHSQLConnection(); DatabaseMetaData md = conn.getMetaData(); System.out.println("supportsTableCorrelationNames - " + md.supportsTableCorrelationNames()); conn.close(); }
From source file:Main.java
public static void main(String args[]) throws Exception { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String URL = "jdbc:odbc:dbName"; Connection dbConn = DriverManager.getConnection(URL, "user", "pass"); PrintWriter w = new PrintWriter(new OutputStreamWriter(System.out)); DriverManager.setLogWriter(w); dbConn.close(); PreparedStatement prepstmt;// w w w . j a va 2 s .co m prepstmt = dbConn.prepareStatement("SELECT id FROM employee"); prepstmt.execute(); prepstmt.close(); dbConn.close(); }