|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.yajul.sql.JdbcHelper
public class JdbcHelper
Utility methods for JDBC.
User: Joshua Davis
Date: Sep 9, 2007
Time: 11:29:59 AM
Field Summary | |
---|---|
static int |
COLUMN_NAME_INDEX
|
static int |
TABLE_NAME_INDEX
|
Constructor Summary | |
---|---|
JdbcHelper()
|
Method Summary | |
---|---|
static void |
close(java.sql.Connection con,
java.sql.Statement stmt,
java.sql.ResultSet rs)
Closes the result set, statement, and connection if they are not null. |
static java.util.List<java.lang.String> |
getColumnNames(java.sql.Connection con,
java.lang.String tableName)
Returns all column names in a table as a list of strings. |
static java.util.List<java.lang.String> |
getTableNames(java.sql.Connection con)
Returns all table names as a list of strings. |
static boolean |
tableExists(java.sql.Connection con,
java.lang.String tableName)
Returns true if the specified table exists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TABLE_NAME_INDEX
public static final int COLUMN_NAME_INDEX
Constructor Detail |
---|
public JdbcHelper()
Method Detail |
---|
public static void close(java.sql.Connection con, java.sql.Statement stmt, java.sql.ResultSet rs)
con
- The connection.stmt
- The statement.rs
- The result set.public static java.util.List<java.lang.String> getTableNames(java.sql.Connection con) throws java.sql.SQLException
con
- a JDBC connection
java.sql.SQLException
- if something went wrongpublic static boolean tableExists(java.sql.Connection con, java.lang.String tableName)
con
- The connection.tableName
- The name of the table to look for.
public static java.util.List<java.lang.String> getColumnNames(java.sql.Connection con, java.lang.String tableName) throws java.sql.SQLException
con
- a JDBC connectiontableName
- The table name
java.sql.SQLException
- if something went wrong
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |