|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.v3x.io.sql.SQLLib
public class SQLLib
Convenience methods for formating sql statements assumes that the Map is in the format ("table attribute", "bean graph map to value") example : fieldA , info.fieldA
| Constructor Summary | |
|---|---|
SQLLib()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
buildCreateStatementFor(java.sql.Connection connexion,
java.lang.String tableName)
Returns a String containing a create table statement for the given table on the given connection. |
static java.lang.String |
buildCreateStatementFor(java.sql.ResultSet results,
java.lang.String tableName)
Returns a String containing a create table statement for the given table on the given connection. |
static java.lang.String |
convert(java.lang.Object victim)
Does smart conversion on objects to turn them into SQL-compatible strings. |
static java.lang.String |
convertAndQuote(java.lang.Object victim)
Does smart conversion on objects to turn them into SQL-compatible values. |
static java.lang.String |
createStatement(java.lang.String tableName,
java.util.Map properties)
returns a SQL create table statement. |
static java.lang.String |
createStatement(java.lang.String tableName,
java.util.Map properties,
java.util.ArrayList prepend)
this is a little kludgey but it allows for forced prepending of data that perhaps isn't included in the object being processed... |
static java.lang.String |
insertStatement(java.lang.String tableName,
java.lang.Object o,
java.util.Map properties)
returns a SQL insert into table statement |
static java.lang.String |
insertStatement(java.lang.String tableName,
java.lang.Object o,
java.util.Map properties,
java.util.ArrayList prepend)
this is a little kludgey but it allows for forced prepending of data that perhaps isn't included in the object being processed... |
static java.util.ArrayList |
listCatalogs(java.sql.Connection connexion)
Lists catalog names in a database. |
static java.util.ArrayList |
listColumns(java.sql.Connection connexion,
java.lang.String tableName)
Lists columns names in a database table. |
static java.util.ArrayList |
listSchemas(java.sql.Connection connexion)
Lists schema names in a database. |
static java.util.Map |
listTableOwners(java.sql.Connection connexion)
Lists tables and their owners in a database. |
static java.util.ArrayList |
listTables(java.sql.Connection connexion)
Lists table names in a database. |
static java.lang.String |
oneFieldQuery(java.sql.Connection connexion,
java.lang.String query)
|
static java.util.Map |
resultSetToMap(java.sql.ResultSet results)
|
static boolean |
sqlTypeRequiresLength(int sqlType)
Returns true if the type requires a length specification. |
static java.lang.String |
sqlTypeToMySQLString(int sqlType)
Returns a string representation of the MySQL equivalent of an SQL column type ID code. |
static java.lang.String |
sqlTypeToMySQLString(int sqlType,
int size)
Returns a string representation of the MySQL equivalent of an SQL column type ID code. |
static java.lang.String |
sqlTypeToString(int sqlType)
Returns a string representation of an SQL column type ID code. |
static java.util.Set |
tablesInQuery(java.lang.String query)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SQLLib()
| Method Detail |
|---|
public static java.util.Map resultSetToMap(java.sql.ResultSet results)
throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String createStatement(java.lang.String tableName,
java.util.Map properties)
public static java.lang.String insertStatement(java.lang.String tableName,
java.lang.Object o,
java.util.Map properties)
public static java.lang.String insertStatement(java.lang.String tableName,
java.lang.Object o,
java.util.Map properties,
java.util.ArrayList prepend)
public static java.lang.String createStatement(java.lang.String tableName,
java.util.Map properties,
java.util.ArrayList prepend)
public static java.lang.String convert(java.lang.Object victim)
public static java.lang.String convertAndQuote(java.lang.Object victim)
public static java.util.ArrayList listTables(java.sql.Connection connexion)
throws java.sql.SQLException
java.sql.SQLException
public static java.util.Map listTableOwners(java.sql.Connection connexion)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static java.util.Set tablesInQuery(java.lang.String query)
public static java.util.ArrayList listCatalogs(java.sql.Connection connexion)
throws java.sql.SQLException
java.sql.SQLException
public static java.util.ArrayList listSchemas(java.sql.Connection connexion)
throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String oneFieldQuery(java.sql.Connection connexion,
java.lang.String query)
throws java.sql.SQLException
java.sql.SQLException
public static java.util.ArrayList listColumns(java.sql.Connection connexion,
java.lang.String tableName)
throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String buildCreateStatementFor(java.sql.Connection connexion,
java.lang.String tableName)
throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String buildCreateStatementFor(java.sql.ResultSet results,
java.lang.String tableName)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static java.lang.String sqlTypeToString(int sqlType)
public static java.lang.String sqlTypeToMySQLString(int sqlType)
public static java.lang.String sqlTypeToMySQLString(int sqlType,
int size)
public static boolean sqlTypeRequiresLength(int sqlType)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||