|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.konakartadmin.db.ExecuteSQL
public class ExecuteSQL
Executes the SQL in the specified input file against the database whose connection details are defined in the specified properties file. It writes output to stdout.
Field Summary | |
---|---|
private static int |
DB2
|
private static boolean |
debug
|
private static java.lang.String |
DEFAULT_FILE_ENCODING
|
private static java.lang.String |
DEFAULT_STORE
|
private static java.lang.String |
inputEncoding
|
private static int |
MSSQL
|
private static int |
MYSQL
|
private static int |
ORACLE
|
private static int |
POSTGRE
|
private static java.lang.String |
usage
|
Constructor Summary | |
---|---|
ExecuteSQL()
|
Method Summary | |
---|---|
private static boolean |
commentLine(java.lang.String line)
|
private static boolean |
emptyLine(java.lang.String line)
|
static int |
execute(java.io.File inFile,
java.io.File propFile)
Execute the SQL against the database defined in the properties file. |
static int |
execute(java.io.File inFile,
java.io.File propFile,
java.lang.String storeId)
Execute the SQL against the database defined in the properties file. |
static int |
execute(java.io.File inFile,
java.io.File propFile,
java.lang.String storeId,
boolean debugFlag)
Execute the SQL against the database defined in the properties file. |
static int |
execute(java.io.File inFile,
java.io.File propFile,
java.lang.String storeId,
java.lang.String kkVer)
Execute the SQL against the database defined in the properties file. |
static int |
execute(java.io.File inFile,
java.io.File propFile,
java.lang.String storeId,
java.lang.String kkVer,
boolean debugFlag)
Execute the SQL against the database defined in the properties file. |
static int |
execute(java.lang.String inFileName,
java.lang.String propFileName)
Execute the SQL against the database defined in the properties file. |
static java.lang.String |
getInputEncoding()
|
private static java.lang.String |
getNextLine(java.util.Scanner br)
|
private static boolean |
kkVersionMarker(java.lang.String line,
java.lang.String kkVer)
|
static void |
main(java.lang.String[] args)
|
private static boolean |
nonSql(java.lang.String line)
|
private static void |
printSQLFailed()
|
private static java.lang.String |
removeFinalString(java.lang.String line,
java.lang.String ch)
|
static void |
setInputEncoding(java.lang.String inputEncoding)
|
private static boolean |
theEnd(java.lang.String line)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String usage
private static final java.lang.String DEFAULT_STORE
private static boolean debug
private static final int DB2
private static final int ORACLE
private static final int POSTGRE
private static final int MSSQL
private static final int MYSQL
private static java.lang.String DEFAULT_FILE_ENCODING
private static java.lang.String inputEncoding
Constructor Detail |
---|
public ExecuteSQL()
Method Detail |
---|
public static void main(java.lang.String[] args) throws java.lang.Exception
args
-
java.lang.Exception
public static int execute(java.lang.String inFileName, java.lang.String propFileName)
inFileName
- the SQL file name to runpropFileName
- the Properties file name that defines the database credentials
public static int execute(java.io.File inFile, java.io.File propFile)
inFile
- the SQL file to runpropFile
- the Properties file that defines the database credentials
public static int execute(java.io.File inFile, java.io.File propFile, java.lang.String storeId)
inFile
- the SQL file to runpropFile
- the Properties file that defines the database credentialsstoreId
-
public static int execute(java.io.File inFile, java.io.File propFile, java.lang.String storeId, java.lang.String kkVer)
inFile
- the SQL file to runpropFile
- the Properties file that defines the database credentialsstoreId
- kkVer
- execute the SQL up to the specified kkVersion. It stops processing the file if it
encounters a line starting with "# vN.N.N.N" or "-- vN.N.N.N". If kkVer is null,
no version checking is carried out.
public static int execute(java.io.File inFile, java.io.File propFile, java.lang.String storeId, boolean debugFlag)
inFile
- the SQL file to runpropFile
- the Properties file that defines the database credentialsstoreId
- debugFlag
- debug flag - true to enable debug
public static int execute(java.io.File inFile, java.io.File propFile, java.lang.String storeId, java.lang.String kkVer, boolean debugFlag)
inFile
- the SQL file to runpropFile
- the Properties file that defines the database credentialsstoreId
- kkVer
- execute the SQL up to the specified kkVersion. It stops processing the file if it
encounters a line starting with "# vN.N.N.N" or "-- vN.N.N.N". If kkVer is null,
no version checking is carried out.debugFlag
- debug flag - true to enable debug
private static void printSQLFailed()
private static boolean commentLine(java.lang.String line)
private static boolean emptyLine(java.lang.String line)
private static boolean theEnd(java.lang.String line)
private static boolean kkVersionMarker(java.lang.String line, java.lang.String kkVer)
private static java.lang.String removeFinalString(java.lang.String line, java.lang.String ch)
private static boolean nonSql(java.lang.String line)
private static java.lang.String getNextLine(java.util.Scanner br)
public static java.lang.String getInputEncoding()
public static void setInputEncoding(java.lang.String inputEncoding)
inputEncoding
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |