/** * INTERNAL: * Build and return an appropriate Accessor. * The default is a DatabaseAccessor. */ public Accessor buildAccessor() { return new DatabaseAccessor(); }
/** * INTERNAL: * Build and return an appropriate Accessor. * The default is a DatabaseAccessor. */ public Accessor buildAccessor() { return new DatabaseAccessor(); }
/** * INTERNAL: * Build and return an appropriate Accessor. * The default is a DatabaseAccessor. */ public Accessor buildAccessor() { return new DatabaseAccessor(); }
DatabaseAccessor accessor = new DatabaseAccessor(); PreparedStatement statement = accessor.getPreparedStatement("SELECT * FROM mainpage WHERE ID=0"); ResultSet resultSet = statement.executeQuery(); resultSet.next(); mainPic = request.getPart("mainPic"); resultSet.updateBlob("mainPic", mainPic.getInputStream());
/** * We may be provided a connection via the properties to use. Check for * one and build a database session around it. Otherwise return the pu * database session. */ public DatabaseSessionImpl getDatabaseSession(Map props) { DatabaseSessionImpl databaseSession = getDatabaseSession(); Object connection = getConfigProperty(PersistenceUnitProperties.SCHEMA_GENERATION_CONNECTION, props); if (connection == null) { return databaseSession; } else { // A connection was provided. Build a database session using that // connection and use the same log level set on the original // database session. DatabaseSessionImpl newDatabaseSession = new DatabaseSessionImpl(); newDatabaseSession.setAccessor(new DatabaseAccessor(connection)); newDatabaseSession.setLogLevel(databaseSession.getLogLevel()); newDatabaseSession.setProject(databaseSession.getProject().clone()); return newDatabaseSession; } }