|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.sql.ConnectionHelper
com.antelmann.sql.SQLServerHelper
public class SQLServerHelper
provides added functionality for Microsoft SQL Server databases
| Constructor Summary | |
|---|---|
SQLServerHelper(Connection con)
|
|
| Method Summary | |
|---|---|
void |
addColumnDefault(String table,
String column,
String value)
|
void |
addColumnDefault(String table,
String column,
String constraintName,
String value)
|
Number |
adjustForColumn(Number number,
int sqltype,
int precision)
|
Object |
adjustForColumn(Object value,
int sqltype,
int precision)
|
Object |
adjustForColumn(Object value,
String column,
MappingInfo mi)
|
void |
changeOwner(String table,
String oldSchema,
String newSchema)
|
int |
copyColumnDefaults(String sourceTable,
Connection target,
String targetTable)
|
boolean |
dropPrimaryKey(String table)
|
Set<String> |
getColumnDefaultConstraintNames(String table)
|
Map<String,Object> |
getColumnDefaults(String table)
returns a map mapping column names to their respective default values. |
ResultSet |
getConstraints(String table)
returns the ResultSet containing the constraints of the given table based on 'exec sp_help'. |
List<String> |
getIndexNames(String table)
somewhat redundant; does the same as ConnectionHelper.getIndicesForTable(String, boolean)
but in an SQLServer-specific way |
static Logger |
getJDBCLogger()
|
String |
getPrimaryKeyConstraintName(String table)
|
ResultSet |
getSpHelp(String table,
int columnIndex,
String columnName)
returns the ResultSet based on 'exec sp_help' for the given table where the given columnIndex is named like columnName If no such ResultSet exist, this method returns null. |
boolean |
is2000()
|
ResultSet |
listOpenConnections()
|
void |
lockTable(boolean exclusive,
String... tables)
useful for early requiring locks to avoid deadlocks |
void |
removeConstraint(String table,
String constraintName)
|
int |
removeDefaults(String table)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SQLServerHelper(Connection con)
| Method Detail |
|---|
public boolean is2000()
throws SQLException
SQLException
public void lockTable(boolean exclusive,
String... tables)
throws SQLException
ConnectionHelper
lockTable in class ConnectionHelperSQLException
public void addColumnDefault(String table,
String column,
String value)
throws SQLException
SQLException
public void addColumnDefault(String table,
String column,
String constraintName,
String value)
throws SQLException
SQLException
public void removeConstraint(String table,
String constraintName)
throws SQLException
SQLException
public ResultSet getSpHelp(String table,
int columnIndex,
String columnName)
throws SQLException
SQLException
public ResultSet listOpenConnections()
throws SQLException
SQLException
public ResultSet getConstraints(String table)
throws SQLException
SQLException
public int copyColumnDefaults(String sourceTable,
Connection target,
String targetTable)
throws SQLException
SQLException
public int removeDefaults(String table)
throws SQLException
SQLException
public Set<String> getColumnDefaultConstraintNames(String table)
throws SQLException
SQLException
public Map<String,Object> getColumnDefaults(String table)
throws SQLException
SQLException
public boolean dropPrimaryKey(String table)
throws SQLException
SQLException
public String getPrimaryKeyConstraintName(String table)
throws SQLException
SQLException
public List<String> getIndexNames(String table)
throws SQLException
ConnectionHelper.getIndicesForTable(String, boolean)
but in an SQLServer-specific way
SQLExceptionConnectionHelper.getIndicesForTable(String, boolean)
public void changeOwner(String table,
String oldSchema,
String newSchema)
throws SQLException,
IllegalArgumentException
SQLException
IllegalArgumentException
public Object adjustForColumn(Object value,
String column,
MappingInfo mi)
throws SQLException,
IllegalArgumentException
SQLException
IllegalArgumentException
public Object adjustForColumn(Object value,
int sqltype,
int precision)
throws SQLException,
IllegalArgumentException
SQLException
IllegalArgumentException
public Number adjustForColumn(Number number,
int sqltype,
int precision)
throws SQLException,
IllegalArgumentException
SQLException
IllegalArgumentExceptionpublic static Logger getJDBCLogger()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||