|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfedora.server.utilities.SQLUtility
public abstract class SQLUtility
SQL-related utility methods.
| Constructor Summary | |
|---|---|
SQLUtility()
|
|
| Method Summary | |
|---|---|
static void |
addRow(java.sql.Connection conn,
java.lang.String table,
java.lang.String[] columns,
java.lang.String[] values,
boolean[] numeric)
Adds a new row. |
static java.lang.String |
aposEscape(java.lang.String in)
|
static java.lang.String |
backslashEscape(java.lang.String in)
|
static void |
closeStatement(java.sql.Statement stmt)
|
static void |
createNonExistingTables(ConnectionPool cPool,
java.io.InputStream dbSpec)
|
static void |
createTables(TableCreatingConnection tcConn,
java.util.List tSpecs)
|
static ConnectionPool |
getConnectionPool(DatastoreConfiguration cpDC)
|
static ConnectionPool |
getConnectionPool(ServerConfiguration fcfg)
|
static java.lang.String |
getLongString(java.sql.ResultSet rs,
int pos)
Get a long string, which could be a TEXT or CLOB type. |
static java.util.List |
getNonExistingTables(java.sql.Connection conn,
java.util.List tSpecs)
|
static void |
replaceInto(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String[] columns,
java.lang.String[] values,
java.lang.String uniqueColumn)
|
static void |
replaceInto(java.sql.Connection conn,
java.lang.String table,
java.lang.String[] columns,
java.lang.String[] values,
java.lang.String uniqueColumn,
boolean[] numeric)
Adds or replaces a row in the given table. |
static java.lang.String |
slashEscaped(java.lang.String in)
|
static boolean |
updateRow(java.sql.Connection conn,
java.lang.String table,
java.lang.String[] columns,
java.lang.String[] values,
java.lang.String uniqueColumn,
boolean[] numeric)
Updates an existing row. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SQLUtility()
| Method Detail |
|---|
public static ConnectionPool getConnectionPool(ServerConfiguration fcfg)
throws java.sql.SQLException
java.sql.SQLException
public static ConnectionPool getConnectionPool(DatastoreConfiguration cpDC)
throws java.sql.SQLException
java.sql.SQLException
public static void replaceInto(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String[] columns,
java.lang.String[] values,
java.lang.String uniqueColumn)
throws java.sql.SQLException
java.sql.SQLException
public static void replaceInto(java.sql.Connection conn,
java.lang.String table,
java.lang.String[] columns,
java.lang.String[] values,
java.lang.String uniqueColumn,
boolean[] numeric)
throws java.sql.SQLException
conn - the connection to usetable - the name of the tablecolumns - the names of the columns whose values we're setting.values - associated valuesuniqueColumn - which column name is unique? The value of this
column will be used in the where clause. It must be
a column which is not numeric.numeric - for each associated column, is it numeric?
if null, all columns are assumed to be strings.
java.sql.SQLException
public static boolean updateRow(java.sql.Connection conn,
java.lang.String table,
java.lang.String[] columns,
java.lang.String[] values,
java.lang.String uniqueColumn,
boolean[] numeric)
throws java.sql.SQLException
java.sql.SQLException
public static void addRow(java.sql.Connection conn,
java.lang.String table,
java.lang.String[] columns,
java.lang.String[] values,
boolean[] numeric)
throws java.sql.SQLException
java.sql.SQLException - if the row could not be added.public static java.lang.String slashEscaped(java.lang.String in)
public static java.lang.String getLongString(java.sql.ResultSet rs,
int pos)
throws java.sql.SQLException
java.sql.SQLException
public static void createNonExistingTables(ConnectionPool cPool,
java.io.InputStream dbSpec)
throws java.io.IOException,
InconsistentTableSpecException,
java.sql.SQLException
java.io.IOException
InconsistentTableSpecException
java.sql.SQLException
public static java.util.List getNonExistingTables(java.sql.Connection conn,
java.util.List tSpecs)
throws java.sql.SQLException
java.sql.SQLException
public static void createTables(TableCreatingConnection tcConn,
java.util.List tSpecs)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static java.lang.String backslashEscape(java.lang.String in)
public static java.lang.String aposEscape(java.lang.String in)
public static void closeStatement(java.sql.Statement stmt)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||