1 2 24 25 package com.lutris.appserver.server.sessionEnhydra.persistent; 26 27 import java.sql.PreparedStatement ; 28 import java.sql.ResultSet ; 29 import java.sql.SQLException ; 30 31 import com.lutris.appserver.server.sql.DBConnection; 32 import com.lutris.appserver.server.sql.Query; 33 34 40 class KeyExistsQuery implements Query { 41 42 private String sessionKey; 43 44 48 KeyExistsQuery(String sessionKey) { 49 this.sessionKey = sessionKey; 50 } 51 52 58 public ResultSet executeQuery(DBConnection conn) 59 throws SQLException { 60 String sql = "select sessionKey from " 61 + PersistentSessionHome.dbTableName 62 + " where sessionKey = ?"; 63 PreparedStatement stmt = conn.prepareStatement(sql); 64 stmt.setString(1, sessionKey); 65 return conn.executeQuery(stmt, sql); 66 } 67 68 78 public Object next(ResultSet rs) throws SQLException { 79 if (rs.next()) { 80 return new Boolean (true); 81 } else { 82 return new Boolean (false); 83 } 84 } 85 86 } 87 | Popular Tags |