User Exit - DB Interface

1. Java Code for User Exit
package com.mirjana.userexit;
import com.sterlingcommerce.woodstock.translator.util.JDBCService;
public class DBInterface {
public Connection getConnection(String poolName)
{
try
catch (Exception e)
}
public PreparedStatement getPreparedStatement(String SQLstatement, Connection con) {
try{
stm = con.prepareStatement(SQLstatement);
return stm;
} catch (Exception e)
}
public ResultSet getResultSet(PreparedStatement stm) {
} catch (Exception e)
}
public int getRowCount(ResultSet res, String SQLstatement)
{
} catch (Exception ex){
}
public void executeNext(ResultSet res)
{
}
public String getData(ResultSet res, String columnName)
return result;
}
public void closePreparedStatement(PreparedStatement stm) {
ex.printStackTrace();
}
}
public void closeResultSet(ResultSet res) {
}
public void closeConnection(Connection con)
public void freeConn(String poolName,Connection con)
2. Pre-Session extended rule
object jdbc_object, connection;
string[100] poolName, table, column, sql_string;
integer i;
object stm, res;
sql_string = "select BUILD_NUMBER, PRODUCT_LABEL from si_version where PRODUCT_LABEL = 'SI'";
// Conn object for obtaining connection
jdbc_object = new("com.mirjana.userexit.DBInterface");
connection = jdbc_object.getConnection("mysqlPool");
i = 1;
3. Extended rule in field level
string[255] sql_result_pl, sql_result_bn, pl, bn;
sql_result_pl = "a";
sql_result_bn = "b";
pl = "PRODUCT_LABEL";
bn = "BUILD_NUMBER";
stm = jdbc_object.getPreparedStatement(sql_string,connection);
res = jdbc_object.getResultSet(stm);
jdbc_object.executeNext(res);
sql_result_pl = jdbc_object.getData(res, pl);
sql_result_bn = jdbc_object.getData(res, bn);
#product_label = sql_result_pl;
#build_number = sql_result_bn;
4. Post-Session extended rule
jdbc_connection.freeConnection(connection) ;