Commit 6fcb38f0 authored by Ajit Deshmukh's avatar Ajit Deshmukh

Replace mailingListIC.java

parent 844939ad
package ibase.webitm.ejb.wsfa.transactions;
package ibase.marketingCampaign;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.system.config.ConnDriver;
import ibase.utility.BaseLogger;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
public class mailingListIC extends ValidatorEJB {
public class MailingListIC extends ValidatorEJB {
E12GenericUtility genericUtility=new E12GenericUtility();
......@@ -68,6 +72,7 @@ public class mailingListIC extends ValidatorEJB {
String name="";
String email_id="";
int currentFormNo = 0;
ConnDriver connDriver = new ConnDriver();
try
{
......@@ -93,12 +98,13 @@ public class mailingListIC extends ValidatorEJB {
// Check for 'S' or 'P'
if ("S".equalsIgnoreCase(mailListType)) {
if ("S".equalsIgnoreCase(mailListType) || "D".equalsIgnoreCase(mailListType)) {
valueXmlString.append("<sql_str protect='0'>").append("<![CDATA[]]>").append("</sql_str>\r\n");
} else if ("P".equalsIgnoreCase(mailListType)) {
valueXmlString.append("<sql_str protect='1'>").append("<![CDATA[]]>").append("</sql_str>\r\n");
}
}
valueXmlString.append ("</Detail1>\r\n");
break;
......@@ -134,6 +140,37 @@ public class mailingListIC extends ValidatorEJB {
BaseLogger.log("3", null, null, "createProject >> XmlString :: [" + "SQL Exception while executing query." + "]");
}
}
else if ("D".equalsIgnoreCase(type)) {
BaseLogger.log("3", null, null, "In dremio databse connection [" + sql + "]");
//Connection code for Dremio Database
try {
conn = connDriver.getConnectDB("APPVIS"+"_IN_MEM",true);
BaseLogger.log("3", null, null, "Connected to Dremio!");
Statement statement = conn.createStatement();
ResultSet resultSet = statement.executeQuery(sql);
while (resultSet.next()) {
System.out.println(resultSet.getString(1));
}
resultSet.close();
statement.close();
conn.close();
}catch (SQLException se) {
BaseLogger.log("3", null, null, "Exception in Dremio Connection [" + E12GenericUtility.getStackTrace(se) + "]");
throw new ITMException(se);
}
}
}
valueXmlString.append ("</Detail2>\r\n");
break;
......@@ -241,7 +278,7 @@ public class mailingListIC extends ValidatorEJB {
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
Connection conn = null;
Connection conn =null;
String childNodeName = null;
String errorString="";
String userId="";
......@@ -282,6 +319,18 @@ public class mailingListIC extends ValidatorEJB {
}
}
// String name = checkNull(genericUtility.getColumnValue("name", dom1));
// String Email = checkNull(genericUtility.getColumnValue("email_id", dom1));
// BaseLogger.log( "3", null, null, "[ value from form 2 name : ("+ name +") ]" );
// BaseLogger.log( "3", null, null, "[ value from form 2 Email : ("+ Email +") ]" );
//
// if(name == null || name.length() == 0 ) {
// errorString= getErrorString("name","VTPRCNCP",userId);
// }else if(Email == null || Email.length() == 0 )
// {
// errorString= getErrorString("Email","VTPRCNCP",userId);
// }
}
}
}catch(Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment