public void destroy() { connections.closeAllConnections(); } }
public UserRepositoryDb(ServletContext servletContext) throws ServletException { connections = JdbcConnections.connectionsFromServletContext(servletContext); try { connection = connections.getDb(); } catch (Exception e) { throw new ServletException("Unable to get default DB from connections",e); } }
public void init(ServletConfig config) throws ServletException { super.init(config); connections = JdbcConnections.connectionsFromServletContext(config.getServletContext()); }
con = connections.getDb(dbs[0]); } catch (Exception e) { throw new ServletException("Error while connecting to database ("+dbs[0]+")",e);
private String GenerateWhereClause(List<Where> whereParms) throws Exception { boolean firstSelect = true; String retVal = ""; Iterator<Where> itWhere = whereParms.iterator(); while( itWhere.hasNext() ) { Where where = itWhere.next(); if( firstSelect ) { firstSelect = false; retVal += " WHERE "; } else { retVal += " AND "; } retVal += (JdbcUtils.safeSqlQueryIdentifier(where.getLeft()) + " " + where.getOp().getSqlQuery() + " "); if( null != where.getStringValue() ) { retVal += (JdbcUtils.safeSqlQueryStringValue(where.getStringValue())); } else { retVal += ""+where.getIntValue(); } } return(retVal); }
sqlQuery += JdbcUtils.safeSqlQueryIdentifier(includeString) + ","; sqlQuery += "ST_X(ST_GeometryN(" + JdbcUtils.safeSqlQueryIdentifier(geomParm) + ",1)) as " + JdbcUtils.safeSqlQueryIdentifier(xnameParm) + ","; sqlQuery += "ST_Y(ST_GeometryN(" + JdbcUtils.safeSqlQueryIdentifier(geomParm) + ",1)) as " + JdbcUtils.safeSqlQueryIdentifier(ynameParm) + " "; sqlQuery += "FROM " + JdbcUtils.safeSqlQueryIdentifier(tableParm) + " ";
sqlQuery += JdbcUtils.safeSqlQueryIdentifier(includeString) + ","; orderByClause += ","; sqlQuery += JdbcUtils.safeSqlQueryIdentifier(fieldString); whereClause += "lower(" + JdbcUtils.safeSqlQueryIdentifier(fieldString) + ") LIKE lower(" + JdbcUtils.safeSqlQueryStringValue("%" + matchText + "%") + ") "; if (1 == fields.size()) { JdbcUtils.safeSqlQueryStringValue(matchText) + ") IN lower(" + JdbcUtils.safeSqlQueryIdentifier(fieldString) + "))"; } else { if (count < (fields.size() - 1)) { orderByClause += "least(coalesce(nullif(position(lower(" + JdbcUtils.safeSqlQueryStringValue(matchText) + ") IN lower(" + JdbcUtils.safeSqlQueryIdentifier(fieldString) + ")), 0), 9999)"; orderByClosing += ")"; } else { orderByClause += "coalesce(nullif(position(lower(" + JdbcUtils.safeSqlQueryStringValue(matchText) + ") IN lower(" + JdbcUtils.safeSqlQueryIdentifier(fieldString) + ")), 0), 9999)"; JdbcUtils.safeSqlQueryIdentifier(scoreParm); sqlQuery += " FROM " + JdbcUtils.safeSqlQueryIdentifier(tableParm) + whereClause + "ORDER BY " + orderByClause + orderByClosing + ";";
int userId = JdbcUtils.extractIntResult(rs,rsmd,1); String email = JdbcUtils.extractStringResult(rs,rsmd,2); String displayName = JdbcUtils.extractStringResult(rs,rsmd,3); String dbPassword = JdbcUtils.extractStringResult(rs,rsmd,4); int groupId = JdbcUtils.extractIntResult(rs,rsmd,5);
public void init(ServletConfig config) throws ServletException { super.init(config); try { connections = JdbcConnections.connectionsFromServletContext(config.getServletContext()); connection = connections.getDb(); } catch (Exception e) { throw new ServletException("Error while connecting to database",e); } queries = new AdhocQueries(connection); }
public void destroy() { if( null != connections ) { connections.closeAllConnections(); } }
sqlQuery += ","; sqlQuery += JdbcUtils.safeSqlQueryIdentifier(selectString); sqlQuery += " FROM " + JdbcUtils.safeSqlQueryIdentifier(tableParm); sqlQuery += ","; sqlQuery += JdbcUtils.safeSqlQueryIdentifier(group);
public void init(ServletConfig config) throws ServletException { super.init(config); try { connections = JdbcConnections.connectionsFromServletContext(config.getServletContext()); connection = connections.getDb(); } catch (Exception e) { throw new ServletException("Error while connecting to database",e); } dbSecurity = new DbSecurity(connection); }
public void destroy() { connections.closeAllConnections(); }
public void init(ServletConfig config) throws ServletException { super.init(config); ServletContext servletContext = config.getServletContext(); try { connections = JdbcConnections.connectionsFromServletContext(servletContext); connection = connections.getDb(); } catch (Exception e) { throw new ServletException("Error while connecting to database",e); } // Load up configuration information Properties props = new Properties(); { if( null != servletContext ) { Object propertiesObj = servletContext.getAttribute(PROPERTIES_SERVLET_ATTRIB_NAME); if( null != propertiesObj && propertiesObj instanceof Properties ) { props = (Properties)propertiesObj; } } } searches = new Searches(props,connection); }
public void destroy() { connections.closeAllConnections(); }
public void init(ServletConfig config) throws ServletException { super.init(config); try { connections = JdbcConnections.connectionsFromServletContext(config.getServletContext()); connection = connections.getDb(); } catch (Exception e) { throw new ServletException("Error while connecting to database",e); } userRepository = UserRepositorySingleton.getSingleton(); contributions = ContributionsUtils.createContibutionHandler(config.getServletContext(), connection); if (null == contributions) { return; } try { ContributionComet contComet = new ContributionCometImpl(config.getServletContext()); contributions.setContributionComet( contComet ); } catch(Exception e) { logger.error("Comet not available for contributions", e); } }
public void destroy() { connections.closeAllConnections(); }
public void destroy() { connections.closeAllConnections(); }