velosurf.sql
Class SqlUtil

java.lang.Object
  extended by velosurf.sql.SqlUtil

public class SqlUtil
extends java.lang.Object

various SQL-related helpers.

Author:
Claude Brisson

Constructor Summary
SqlUtil()
           
 
Method Summary
static java.util.List<java.lang.String> getColumnNames(java.sql.ResultSet resultSet)
          get the column nams of a result set
static java.lang.String orderQuery(java.lang.String query, java.lang.String order)
          add an ordering clause to a query
static java.lang.String refineQuery(java.lang.String query, java.util.List criteriaList)
          add seach criteria to a query
private static java.lang.String stars(int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlUtil

public SqlUtil()
Method Detail

stars

private static java.lang.String stars(int length)

refineQuery

public static java.lang.String refineQuery(java.lang.String query,
                                           java.util.List criteriaList)
add seach criteria to a query

Parameters:
query - query
criteriaList - list of criteria
Returns:
new query

orderQuery

public static java.lang.String orderQuery(java.lang.String query,
                                          java.lang.String order)
add an ordering clause to a query

Parameters:
query - initial query
order - order clause
Returns:
ordered query

getColumnNames

public static java.util.List<java.lang.String> getColumnNames(java.sql.ResultSet resultSet)
                                                       throws java.sql.SQLException
get the column nams of a result set

Parameters:
resultSet - result set
Returns:
list of columns
Throws:
java.sql.SQLException


~ooOoo~