Hi Senthil,I want output like below.
inputRec
documentid
outRec
outRec[0]
DocumentID
outRec[1]
DocumentID
outRec[3]
DocumentID
I got the above output using Values in but i want the same output with IData Pipeline.Please help me as i am new to web methods.
Below is my code using Values in
Connection c = null;
Statement s = null;
Values audit = new Values(5);
try {
String WhereCondition = in.getTrimmedString(“WhereCondition”);
String Table = in.getTrimmedString(“Table”);
// DB connection parameters
Values DBRec = in.getValues("DBrec");
String dbUrl = "";
String user = "";
String password = "";
String DBClass = "";
if ((DBRec == null) || (DBRec.isEmpty()) || (isEmpty(DBRec.getString("DBUrl")))) {
dbUrl = getParameter("dbURLSOM" , "SpGeneralUtil");
user = getParameter("dbUserSOM", "SpGeneralUtil");
password = getParameter("dbPassSOM", "SpGeneralUtil");
DBClass = getParameter("dbDriver" , "SpGeneralUtil");
}
else {
dbUrl = DBRec.getString("DbUrl");
user = DBRec.getString("User");
password = DBRec.getString("Pwd");
DBClass = DBRec.getString("DBClass");
}
// establish DB connection
Class.forName( DBClass );
c = DriverManager.getConnection(dbUrl, user, password);
s = c.createStatement();
c.setAutoCommit(false);
String [] columnList = in.getStringArray("tblPODetailColumnList");
// get tblPODetail columns if provided
String selectList = "";
if (columnList != null) {
for (int i=0; i < columnList.length; i++) {
if (!isEmpty(columnList[i])) selectList += columnList[i];
if (((i+1) != columnList.length) && (!isEmpty(columnList[i+1])) ) selectList += ", ";
}
}
else selectList = " * ";
String Query = null;
Query = "SELECT " + selectList + " " +
"FROM " + Table + " " +
"WHERE " + WhereCondition + " ";
s.execute(Query);
SpDBUtil.toOutputValues(s.getResultSet(), out, "outRec", true);
int rowCount = out.getInt("rowCount");
if (rowCount <= 0) throw new Exception("Row Count : Quotation details not found." );
if (s != null) s.close();
if (c != null) c.close();
exitSuccess("Retrieved Quotation Information successfully.", out);
}
catch (Exception e) {
try {
if (s != null) s.close();
if (c != null) c.close();
}
catch (SQLException f) {
}
return exitError("SpDBUtil.AdminDBUtil:getDocumentList Exception. " + e.getMessage(), out, audit);
}
#Flow-and-Java-services#Integration-Server-and-ESB#webMethods