com.wm.app.tn.db
Class SQLStatements
java.lang.Object
com.wm.app.tn.db.SQLStatements
public class SQLStatements
- extends java.lang.Object
Method Summary |
static java.lang.String |
getSql(java.lang.String which)
Get a single SQL operation. |
static void |
init(java.io.File configDir)
|
static void |
init(java.io.File configDir,
boolean cacheStatements,
boolean logSql)
|
static java.util.Hashtable |
loadOpsFromFile(java.io.File sqlFile,
boolean readVersion,
java.util.Hashtable ops)
|
static void |
main(java.lang.String[] args)
|
static java.sql.PreparedStatement |
prepareStatement(java.sql.Connection conn,
java.lang.String which)
Prepare a statement. |
static void |
releaseStatement(java.sql.PreparedStatement stmt)
Release a previously prepared statement. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SQLStatements
public SQLStatements()
init
public static void init(java.io.File configDir)
throws java.io.IOException
- Throws:
java.io.IOException
init
public static void init(java.io.File configDir,
boolean cacheStatements,
boolean logSql)
throws java.io.IOException
- Throws:
java.io.IOException
loadOpsFromFile
public static java.util.Hashtable loadOpsFromFile(java.io.File sqlFile,
boolean readVersion,
java.util.Hashtable ops)
throws java.io.IOException
- Throws:
java.io.IOException
getSql
public static java.lang.String getSql(java.lang.String which)
throws java.sql.SQLException
- Get a single SQL operation.
- Parameters:
which
- the SQL operation to fetch (e.g. "bda.select.all")
- Returns:
- the defined SQL operation
- Throws:
java.sql.SQLException
- if the specified operation hasn't been defined, or the operations haven't been
read from disk
prepareStatement
public static java.sql.PreparedStatement prepareStatement(java.sql.Connection conn,
java.lang.String which)
throws java.sql.SQLException
- Prepare a statement.
- Parameters:
conn
- the connection on which to prepare the statementwhich
- which SQL statement to prepare
- Throws:
java.sql.SQLException
- if the specified operation hasn't been defined, or the operations haven't been
read from disk
releaseStatement
public static void releaseStatement(java.sql.PreparedStatement stmt)
- Release a previously prepared statement. If statement caching is turned off, the statement is closed, otherwise
nothing happens.
- Parameters:
stmt
- the statement to close
- Throws:
java.sql.SQLException
- if an error happens on the close
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception