|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.directj.jlogger.JDBCOutput
This is a simple class that print logging information into a specified DataBase. You have to specify the Driver to use to connect the DB. Moreover, each information is numeroted, in order of arrival. This class is about to be modified in future release.
Field Summary | |
private java.lang.String |
dbName
The table name. |
private java.lang.String |
dbPass
The user password. |
private java.lang.String |
dbURL
The database URL. |
private java.lang.String |
dbUser
The user name. |
private java.sql.PreparedStatement |
insertLog
The SQL statement used to insert a log. |
private int |
num
The current rank of inserted data. |
Constructor Summary | |
JDBCOutput(java.lang.String _dbURL,
java.lang.String _driverName,
java.lang.String _dbName,
java.lang.String _dbUser,
java.lang.String _dbPass,
boolean _create)
Creates a new JDBCOutput. |
Method Summary | |
boolean |
equals(java.lang.Object _obj)
Indicates whether some other object is "equal to" this one. |
int |
hashCode()
Returns a hash code value for the object. |
void |
print(java.lang.String _str)
Prints the info, using the output. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.String dbURL
private java.lang.String dbName
private java.lang.String dbUser
private java.lang.String dbPass
private java.sql.PreparedStatement insertLog
private int num
Constructor Detail |
public JDBCOutput(java.lang.String _dbURL, java.lang.String _driverName, java.lang.String _dbName, java.lang.String _dbUser, java.lang.String _dbPass, boolean _create)
num INT NOT NULL PRIMARY KEY, type VARCHAR(50) NOT NULL, from VARCHAR(50) NOT NULL, at VARCHAR(50) NOT NULL, message VARCHAR(255) NOT NULL
').
There is two reason of possible error: The table does not respect the above structure, or the table is not empty and the 'num' variable
can be in double (that is not allowed because of it's the primary key). This implementation is about to be
modified in future release.
_dbURL
- The database url, like 'jdbc:odbc:database'._driverName
- The name of the class that will be loaded as the DB driver, like 'sun.jdbc.odbc.JdbcOdbcDriver'._dbName
- The name of the table, in the _dbURL DB._dbUser
- The user name to access the DB._dbPass
- The user password to access the DB._create
- Indicate if we create a new table or use an existing one.Method Detail |
public void print(java.lang.String _str)
print
in interface Output
_str
- The debugging info to print on the output.Formatter
public boolean equals(java.lang.Object _obj)
equals
in class java.lang.Object
_obj
- The reference object with which to compare.
boolean
- True if this object is the same as the obj argument; false otherwise.public int hashCode()
hashCode
in class java.lang.Object
int
- A hash code value for this object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |