org.mentabean.util
Class SQLUtils
java.lang.Object
org.mentabean.util.SQLUtils
public class SQLUtils
- extends Object
|
Method Summary |
static boolean |
checkIfTableExists(Connection conn,
String tableName)
|
static void |
close(ResultSet rset,
Statement stmt)
|
static void |
close(ResultSet rset,
Statement stmt,
Connection conn)
|
static void |
close(Statement stmt)
|
static void |
close(Statement stmt,
Connection conn)
|
static void |
executeScript(Connection conn,
String file,
String charset)
|
static int |
fillStatement(PreparedStatement stmt,
Object... params)
Fill the given PreparedStatement object with the specified parameters.
Note that this method uses the setObject method which depends
of a specified JDBC driver implementation to work properly.
|
static int |
fillStatementIndx(PreparedStatement stmt,
int indx,
Object... params)
Fill the given PreparedStatement object with the specified parameters
starting at indx position.
Note that this method uses the setObject method which depends
of a specified JDBC driver implementation to work properly.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SQLUtils
public SQLUtils()
executeScript
public static void executeScript(Connection conn,
String file,
String charset)
checkIfTableExists
public static boolean checkIfTableExists(Connection conn,
String tableName)
close
public static void close(Statement stmt)
close
public static void close(ResultSet rset,
Statement stmt)
close
public static void close(Statement stmt,
Connection conn)
close
public static void close(ResultSet rset,
Statement stmt,
Connection conn)
fillStatement
public static int fillStatement(PreparedStatement stmt,
Object... params)
- Fill the given
PreparedStatement object with the specified parameters.
Note that this method uses the setObject method which depends
of a specified JDBC driver implementation to work properly.
- Parameters:
stmt - - The PreparedStatement objectparams - - Values that will be added in statement
- Returns:
- The last index added plus 1. It can be useful for continuous statement filling operations.
- See Also:
fillStatementIndx(PreparedStatement, int, Object...),
PreparedStatement.setObject(int, Object)
fillStatementIndx
public static int fillStatementIndx(PreparedStatement stmt,
int indx,
Object... params)
- Fill the given
PreparedStatement object with the specified parameters
starting at indx position.
Note that this method uses the setObject method which depends
of a specified JDBC driver implementation to work properly.
- Parameters:
stmt - - The PreparedStatement objectindx - - Initial index for setting attributes in statementparams - - Values that will be added in statement
- Returns:
- The next index (last added plus 1). It can be useful for continuous statement filling operations.
- See Also:
fillStatement(PreparedStatement, Object...),
PreparedStatement.setObject(int, Object)
Copyright © 2012. All Rights Reserved.