se.unlogic.standardutils.db
Class DBUtils
java.lang.Object
se.unlogic.standardutils.db.DBUtils
public class DBUtils
- extends Object
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(DataSource dataSource,
String tableName)
throws SQLException
- Throws:
SQLException
listAllTables
public static ArrayList<String> listAllTables(Connection connection)
throws SQLException
- Throws:
SQLException
getDataSource
public static DataSource getDataSource(String name)
throws NamingException
- Throws:
NamingException
containsColumn
public static boolean containsColumn(ResultSet rs,
String columnName)
getTableColumns
public static List<String> getTableColumns(Connection connection,
String selectedTable)
throws SQLException
- Throws:
SQLException
getTableColumnCount
public static int getTableColumnCount(DataSource dataSource,
String selectedTable)
throws SQLException
- Throws:
SQLException
closeConnection
public static void closeConnection(Connection connection)
closeResultSet
public static void closeResultSet(ResultSet rs)
closePreparedStatement
public static void closePreparedStatement(PreparedStatement pstmt)
Copyright © 2011. All Rights Reserved.