How to get the data from different environments:
public void getDatafromApps(){
ResultSet resultset=null;
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:user_name/password@//Host:port:SID");
Statement statement = conn.createStatement();
String sql="select segment1,type_lookup_code from apps.po_headers_all where po_header_id=117";
resultset = statement.executeQuery(sql);
if(resultset.next())
{
System.out.println("-----------------------");
System.out.println(resultset.getString(1));
Segment1=resultset.getString(1);
System.out.println(resultset.getString(2));
System.out.println("-----------------------");
}
}
catch (SQLException e) {
System.out.println(e.getMessage());
}
}
//get the SOA details
public void getSOAData(){
char quotes ='"';
ResultSet resultset=null;
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:user_name/password@//Host:port/serviceName");
Statement statement = conn.createStatement();
String sql= "select count(*) countOfrec from SOA."+quotes+"_SAPTable"+quotes;
System.out.println(sql);
resultset = statement.executeQuery(sql);
if(resultset.next())
{
System.out.println("-----------------------");
System.out.println(resultset.getString(1));
countrec=resultset.getString(1);
System.out.println("-----------------------");
}
}
catch (SQLException e) {
System.out.println(e.getMessage());
}
}
public void getDatafromApps(){
ResultSet resultset=null;
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:user_name/password@//Host:port:SID");
Statement statement = conn.createStatement();
String sql="select segment1,type_lookup_code from apps.po_headers_all where po_header_id=117";
resultset = statement.executeQuery(sql);
if(resultset.next())
{
System.out.println("-----------------------");
System.out.println(resultset.getString(1));
Segment1=resultset.getString(1);
System.out.println(resultset.getString(2));
System.out.println("-----------------------");
}
}
catch (SQLException e) {
System.out.println(e.getMessage());
}
}
//get the SOA details
public void getSOAData(){
char quotes ='"';
ResultSet resultset=null;
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:user_name/password@//Host:port/serviceName");
Statement statement = conn.createStatement();
String sql= "select count(*) countOfrec from SOA."+quotes+"_SAPTable"+quotes;
System.out.println(sql);
resultset = statement.executeQuery(sql);
if(resultset.next())
{
System.out.println("-----------------------");
System.out.println(resultset.getString(1));
countrec=resultset.getString(1);
System.out.println("-----------------------");
}
}
catch (SQLException e) {
System.out.println(e.getMessage());
}
}
No comments:
Post a Comment