And these are the complete servlet functions that are used to add records
into these 2 tables:
protected void log2db(HttpServletRequest request, String action, String
message) {
try {
if(this.conn == null ){
Class.forName("com.mysql.jdbc.Driver").newInstance();
this.conn = DriverManager.getConnection(mysqlUrl,
mysqlUser, mysqlPwd);
}
HttpSession session = request.getSession(false);
String user_email = (String) session.getAttribute("user_email");
DSLContext database = DSL.using(this.conn, SQLDialect.MYSQL);
LogsRecord logItem = database.newRecord(Tables.LOGS);
logItem.setUserEmail(user_email);
logItem.setAction(action);
logItem.setMessage(message);
logItem.store();
} catch (Exception ex){
logText(ex.getMessage());
}
}
protected void dataset2db(HttpServletRequest request, String
datasetName){
try {
if(this.conn == null ){
Class.forName("com.mysql.jdbc.Driver").newInstance();
this.conn = DriverManager.getConnection(mysqlUrl,
mysqlUser, mysqlPwd);
}
HttpSession session = request.getSession(false);
String user_email = (String) session.getAttribute("user_email");
DSLContext database = DSL.using(this.conn, SQLDialect.MYSQL);
DatasetsRecord record = database.newRecord(Tables.DATASETS);
record.setUserEmail(user_email);
record.setName(datasetName);
record.store();
} catch (Exception ex){
log2db(request,"info","Adding dataset record in DB failed.
Reason: "+ex.getMessage());
}
}
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.