/** * Constructs a new Session that operates within (is connected to) the context of this Database * object. * * <p>If successful, the new Session object initially operates on behalf of the user specified by * the supplied user name. * * <p>Throws if username or password is invalid. */ synchronized Session connect(String username, String password) throws HsqlException { User user = userManager.getUser(username, password); Session session = sessionManager.newSession(this, user, databaseReadOnly, false); logger.logConnectUser(session); return session; }
/** * Constructs a new Session that operates within (is connected to) the context of this Database * object. * * <p>If successful, the new Session object initially operates on behalf of the user specified by * the supplied user name. * * @param username the name of the initial user of this session. The user must already exist in * this Database object. * @param password the password of the specified user. This must match the password, as known to * this Database object, of the specified user * @return a new Session object that initially that initially operates on behalf of the specified * user * @throws SQLException if the specified user does not exist or a bad password is specified */ synchronized Session connect(String username, String password) throws SQLException { User user = aAccess.getUser(username.toUpperCase(), password.toUpperCase()); Session session = sessionManager.newSession(this, user, databaseReadOnly); logger.writeToLog(session, "CONNECT USER " + username + " PASSWORD \"" + password + "\""); return session; }
/** * Constructs a new Session that operates within (is connected to) the context of this Database * object. * * <p>If successful, the new Session object initially operates on behalf of the user specified by * the supplied user name. * * <p>Throws if username or password is invalid. */ synchronized Session connect( String username, String password, String zoneString, int timeZoneSeconds) { if (username.equalsIgnoreCase("SA")) { username = "******"; } User user = userManager.getUser(username, password); Session session = sessionManager.newSession(this, user, databaseReadOnly, true, zoneString, timeZoneSeconds); return session; }