@Test public void testBlobWritingReading() throws SQLException { Connection conn = dbResource.getConnection(); DBDatabaseDriver driver = dbResource.newDriver(); CompanyDB db = new CompanyDB(); db.open(driver, dbResource.getConnection()); DBRecord emp = new DBRecord(); emp.create(db.DATA); emp.setValue(db.DATA.DATA, new byte[]{1,2,3}); emp.update(conn); DBCommand cmd = db.createCommand(); cmd.select(db.DATA.DATA); DBReader reader = new DBReader(); reader.open(cmd, conn); while(reader.moveNext()){ byte[] value = (byte[]) reader.getValue(db.DATA.DATA); Assert.assertArrayEquals(new byte[]{1,2,3}, value); } conn.close(); }
@Override public DBCommand createCommand(DBDatabase db) { if (db == null) return null; return new DBCommandPostreSQL(db); }
DBDatabaseDriverPostgreSQL extends DBDatabaseDriver { @Override public DBCommand createCommand(DBDatabase db) { if (db == null) return null; return new DBCommandPostreSQL(db); } }
DBDatabaseDriverPostgreSQL extends DBDatabaseDriver { @Override public DBCommand createCommand(DBDatabase db) { if (db == null) return null; return new DBCommandPostreSQL(db); } DBDatabaseDriverPostgreSQL(); }
DBDatabaseDriverPostgreSQL extends DBDatabaseDriver { @Override public DBCommand createCommand(DBDatabase db) { if (db == null) return null; return new DBCommandPostreSQL(db); } DBDatabaseDriverPostgreSQL(); String getDatabaseName(); void setDatabaseName(String databaseName); void createReverseFunction(Connection conn); @Override DBCommand createCommand(DBDatabase db); @Override boolean isSupported(DBDriverFeature type); @Override String getSQLPhrase(int phrase); @Override String getConvertPhrase(DataType destType, DataType srcType, Object format); @Override Object getNextSequenceValue(DBDatabase db, String seqName, int minValue, Connection conn); @Override DBColumnExpr getNextSequenceValueExpr(DBTableColumn column); @Override java.sql.Timestamp getUpdateTimestamp(Connection conn); @Override void getDDLScript(DBCmdType type, DBObject dbo, DBSQLScript script); @Override Object getResultValue(ResultSet rset, int columnIndex, DataType dataType); }
DBDatabaseDriverPostgreSQL extends DBDatabaseDriver { @Override public DBCommand createCommand(DBDatabase db) { if (db == null) return null; return new DBCommandPostreSQL(db); } DBDatabaseDriverPostgreSQL(); String getDatabaseName(); void setDatabaseName(String databaseName); void createReverseFunction(Connection conn); @Override DBCommand createCommand(DBDatabase db); @Override boolean isSupported(DBDriverFeature type); @Override String getSQLPhrase(int phrase); @Override String getConvertPhrase(DataType destType, DataType srcType, Object format); @Override Object getNextSequenceValue(DBDatabase db, String seqName, int minValue, Connection conn); @Override DBColumnExpr getNextSequenceValueExpr(DBTableColumn column); @Override java.sql.Timestamp getUpdateTimestamp(Connection conn); @Override void getDDLScript(DBCmdType type, DBObject dbo, DBSQLScript script); @Override Object getResultValue(ResultSet rset, int columnIndex, DataType dataType);  }