AnsweredAssumed Answered

java script step:code working fine in eclipse but the same code not return value in LISA

Question asked by VijayCSidharth on Dec 31, 2015

After execution of this code in LISA as Java script step getting  a window pop with message "Test executed with no result" without any error. the same java code return the value when i tested in Eclipse. Can anyone help or suggest me what I need to add here, just an idea ,instead of using String variable ,should I need return some LISA variable?

 

import java.sql.*;

 

String sqlQuery="Any SELECT Query";

try{

ResultSet rs=null;

Statement stmt=null;

Class.forName("oracle.jdbc.driver.OracleDriver");

Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@xyz:1524:test", "xyz", "xyz");

StringBuffer strEdge = new StringBuffer();

 

stmt=conn.createStatement();

rs=stmt.executeQuery(sqlQuery);

ResultSetMetaData metadata = rs.getMetaData();

int numberOfColumns = metadata.getColumnCount();

 

while(rs.next()){

int i=1;

while(i <= numberOfColumns){

strEdge.append(rs.getString(i++));

strEdge.append("~");

}

String strE = strEdge.toString();

strE = strE.replace("null", "");

}

rs.close();

stmt.close();

}catch(Exception e){e.printStackTrace();}

 

return strE;

Outcomes