|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mays.util.Sql
public class Sql
Some convenience methods for doing JDBC.
| Field Summary | |
|---|---|
static Logger |
LOGGER
|
| Constructor Summary | |
|---|---|
Sql()
|
|
| Method Summary | |
|---|---|
static int |
countTable(Connection conn,
String name)
Count the rows |
static void |
createIndex(Connection conn,
String table,
String column)
Create the index using the table and column names for the index name |
static void |
createTable(Connection conn,
String name,
String def)
Create a table |
static void |
dropTable(Connection conn,
String name)
Drop the table, but catch the "does not exist error", log it, and proceed. |
static Connection |
getConnection()
Deprecated. |
static Connection |
getConnection(String schema)
Deprecated. |
static Connection |
getConnection(String derby_home,
String schema)
Establish a JDBC connection to an Apache Derby db, creating one if necessary, using the embedded driver. |
static Connection |
getOdbcConnection(String dsn)
Establish a JDBC connection to an ODBC db Useful for extracting data from MS Access |
static void |
setIntOrNull(PreparedStatement stmt,
int parameter_i,
String value)
Set an int parameter on a PreparedStatement from a String, doing the right thing if the string is empty |
static void |
shutdown()
Deprecated. |
static void |
shutdown(String schema)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static Logger LOGGER
| Constructor Detail |
|---|
public Sql()
| Method Detail |
|---|
public static Connection getConnection(String derby_home,
String schema)
throws Exception
derby_home - schema -
Exception
@Deprecated
public static Connection getConnection(String schema)
throws Exception
schema -
Exception
@Deprecated
public static Connection getConnection()
throws Exception
Exception
public static void shutdown(String schema)
throws Exception
Exception
@Deprecated
public static void shutdown()
throws Exception
Exception
public static Connection getOdbcConnection(String dsn)
throws Exception
dsn -
Exception
public static void dropTable(Connection conn,
String name)
throws Exception
conn - name -
Exception
public static void createTable(Connection conn,
String name,
String def)
throws Exception
conn - name - def -
Exception
public static int countTable(Connection conn,
String name)
throws Exception
conn - name -
Exception
public static void createIndex(Connection conn,
String table,
String column)
throws Exception
conn - table - column -
Exception
public static void setIntOrNull(PreparedStatement stmt,
int parameter_i,
String value)
throws Exception
stmt - parameter_i - value -
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||