org.LexGrid.util.sql
Class GenericSQLModifier
java.lang.Object
org.LexGrid.util.sql.GenericSQLModifier
public class GenericSQLModifier
- extends java.lang.Object
A class to read my quasi-sql and convert it to database specific sql.
Currently supports MySQL, MS Access, PostgreSQL, DB2 (various flavors),
HyperSonic SQL and Microsoft SQL Server
- Author:
- Dan Armbrust
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mySqlLikeOverride
public static java.lang.String mySqlLikeOverride
GenericSQLModifier
public GenericSQLModifier(java.sql.Connection connection,
boolean sqlLite)
throws java.lang.Exception
- Parameters:
connection
- the connectionsqlLite
- true if connection is SQLLite, false if SQL
- Throws:
java.lang.Exception
GenericSQLModifier
public GenericSQLModifier(java.sql.Connection connection)
throws java.lang.Exception
- Parameters:
connection
- the connection
- Throws:
java.lang.Exception
GenericSQLModifier
public GenericSQLModifier(java.lang.String databaseType,
boolean sqlLite)
throws java.lang.Exception
- Parameters:
databaseType
- may be "MySQL", "ACCESS", "PostgreSQL", "DB2*",
"Microsoft SQL Server", "HSQL Database Engine"sqlLite
- if true, database is SQLLite, if false database is SQL
- Throws:
java.lang.Exception
getDatabaseType
public java.lang.String getDatabaseType()
- Returns:
- what type of database it is.
modifySQL
public java.lang.String modifySQL(java.lang.String sql,
boolean logResult)
- Parameters:
sql
- logResult
- log result if true
- Returns:
- the modified sql statement
modifySQL
public java.lang.String modifySQL(java.lang.String sql)
requiresLikeQueryTextToBeUpperCased
public boolean requiresLikeQueryTextToBeUpperCased()
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception