|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcc.glsn.v15.SQLConnection
public class SQLConnection
This class opens an SQL connection and allows you to run queries on it.
| Constructor Summary | |
|---|---|
SQLConnection(ConfigFile C)
Create an SQLConnection using strings SQLDiver, SQLUrl, SQLUsername and SQLPassword from the given cc.glsn.ConfigFile. |
|
SQLConnection(String Driver,
String URL,
String Username,
String Password)
|
|
| Method Summary | |
|---|---|
void |
close()
Close DB connection. |
void |
commit()
Commit changes to DB. |
ResultSet |
doSingleQuery(String Str)
Do an SQL query. |
ResultSet |
doSingleUpdatableQuery(String Str)
Do an SQL query. |
int |
doStatement(String Str)
performs a single SQL statement |
Connection |
getDBConnection()
|
boolean |
ok()
Determines if the connection is ok |
void |
reset()
Reset auto commit to true Close any open statements |
void |
setAutoCommit(boolean B)
Sets the value of autocommit. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SQLConnection(ConfigFile C)
throws SQLException
C - ConfigFile to grab params from
SQLException
public SQLConnection(String Driver,
String URL,
String Username,
String Password)
throws SQLException
Driver - Class of SQL driver to use. Example: com.mysql.jdbc.DriverURL - URL to database. Example: jdbc:mysql://host/dbnameUsername - Password -
SQLException| Method Detail |
|---|
public void reset()
throws SQLException
SQLException
public void close()
throws SQLException
SQLException
public void commit()
throws SQLException
SQLException
public void setAutoCommit(boolean B)
throws SQLException
B -
SQLExceptionpublic boolean ok()
public int doStatement(String Str)
throws SQLException
Str - The SQL statement to run
SQLException
public ResultSet doSingleQuery(String Str)
throws SQLException
Str - Query
SQLException
public ResultSet doSingleUpdatableQuery(String Str)
throws SQLException
Str - Quert
SQLExceptionpublic Connection getDBConnection()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||