private void validateSth() throws Exception { synchronized (this) { if (sth==null || sth.isClosed()) { Connection con = dbCon.getConnection(); sth = con.createStatement(); } } }
protected PreparedStatement prepareStatement(Map<String, Object> attributes, Statement sth, String query ) throws SQLException { // recycle prepared query - should not differ ! if (xquery != null & preparedSth != null && xquery.equals(query)) return preparedSth; // if differ close last prepared query closePreparedSth(); // checkout new if (attributes != null && attributes.containsKey( RETURN_BINARY_KEY + "0")) { PreparedStatement psth = dbCon.getConnection().prepareStatement(query); xquery = query; for (int nr = 0; attributes.containsKey(RETURN_BINARY_KEY + nr); nr++) { psth.setBinaryStream(nr+1, (InputStream) attributes.get(RETURN_BINARY_KEY + nr)); attributes.remove(RETURN_BINARY_KEY + nr); } return psth; } return null; }
Connection con = ((JdbcConnection)db.instance()).getConnection(); Statement sth = con.createStatement();
public void createIndexes(IConfig data, DbConnection db, MetadataBundle caoMeta, boolean cleanup) throws Exception { Connection con = ((JdbcConnection)db.instance()).getConnection(); Statement sth = con.createStatement(); DatabaseMetaData meta = con.getMetaData();
public void createTables(IConfig data, DbConnection db, MetadataBundle caoBundle, boolean cleanup) throws Exception { Connection con = ((JdbcConnection)db.instance()).getConnection(); Statement sth = con.createStatement(); DatabaseMetaData meta = con.getMetaData();