|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--iglu.jdbc.JDBCUtils
General utilities for database access.
| Constructor Summary | |
JDBCUtils()
|
|
| Method Summary | |
static boolean |
doCommit(java.sql.Connection db)
Convienence method to do a commit and catch the exception. |
static java.sql.ResultSet |
doSQL(java.sql.Connection db,
java.lang.String sqlQuery)
|
static java.lang.Integer |
firstSqlInt(java.sql.Connection db,
java.lang.String sqlQuery)
returns as an Integer the first field of the first row returned in the sql query. |
static java.lang.String |
firstSqlString(java.sql.Connection db,
java.lang.String sqlQuery)
returns as a string the first field of the first row returned in the sql query. |
static void |
loadPGSQLDriver()
Forces the PGSQL driver to load. |
static java.sql.Connection |
makeConnection(java.lang.String url,
java.lang.String name,
java.lang.String password)
Connects to a database, while providing debugging output. |
static int |
numRows(java.sql.ResultSet rs)
Returns the number of touples in the result set. |
static boolean |
tryUpdate(java.sql.Connection db,
java.lang.String sqlQuery)
Execute an update. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JDBCUtils()
| Method Detail |
public static void loadPGSQLDriver()
org.postgresql.Driver unless the Postgresql people
change it.
public static java.sql.Connection makeConnection(java.lang.String url,
java.lang.String name,
java.lang.String password)
url - The location of the database in the form of
jdbc:postgresql://host/databasenamename - Login name of the person connecting to the database.password - Password of the person connecting.
public static java.sql.ResultSet doSQL(java.sql.Connection db,
java.lang.String sqlQuery)
public static java.lang.String firstSqlString(java.sql.Connection db,
java.lang.String sqlQuery)
db - Database to send the string.sqlQuery - The query to send.
public static java.lang.Integer firstSqlInt(java.sql.Connection db,
java.lang.String sqlQuery)
db - Database to send the string.sqlQuery - The query to send.
public static boolean tryUpdate(java.sql.Connection db,
java.lang.String sqlQuery)
public static boolean doCommit(java.sql.Connection db)
db - a Connection value
boolean valuepublic static int numRows(java.sql.ResultSet rs)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||