se.unlogic.standardutils.db
Class DBUtils
java.lang.Object
se.unlogic.standardutils.db.DBUtils
public class DBUtils
- extends java.lang.Object
Method Summary |
static void |
closeConnection(java.sql.Connection connection)
|
static void |
closePreparedStatement(java.sql.PreparedStatement pstmt)
|
static void |
closeResultSet(java.sql.ResultSet rs)
|
static boolean |
containsColumn(java.sql.ResultSet rs,
java.lang.String columnName)
|
static javax.sql.DataSource |
getDataSource(java.lang.String name)
|
static int |
getTableColumnCount(javax.sql.DataSource dataSource,
java.lang.String selectedTable)
|
static java.util.List<java.lang.String> |
getTableColumns(java.sql.Connection connection,
java.lang.String selectedTable)
|
static java.util.ArrayList<java.lang.String> |
listAllTables(java.sql.Connection connection)
|
static boolean |
tableExists(javax.sql.DataSource dataSource,
java.lang.String tableName)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DBUtils
public DBUtils()
tableExists
public static boolean tableExists(javax.sql.DataSource dataSource,
java.lang.String tableName)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
listAllTables
public static java.util.ArrayList<java.lang.String> listAllTables(java.sql.Connection connection)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
getDataSource
public static javax.sql.DataSource getDataSource(java.lang.String name)
throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
containsColumn
public static boolean containsColumn(java.sql.ResultSet rs,
java.lang.String columnName)
getTableColumns
public static java.util.List<java.lang.String> getTableColumns(java.sql.Connection connection,
java.lang.String selectedTable)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
getTableColumnCount
public static int getTableColumnCount(javax.sql.DataSource dataSource,
java.lang.String selectedTable)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
closeConnection
public static void closeConnection(java.sql.Connection connection)
closeResultSet
public static void closeResultSet(java.sql.ResultSet rs)
closePreparedStatement
public static void closePreparedStatement(java.sql.PreparedStatement pstmt)
Copyright © 2011. All Rights Reserved.