web stats
Mirth Community - View Single Post - ORA data will not get returned
View Single Post
  #5  
Old 09-07-2012, 11:02 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,115
narupley is on a distinguished road
Default

Here's an example with a JavaScript Reader:

Code:
var list = new java.util.ArrayList();

importPackage(java.sql);
var dbConn = DriverManager.getConnection(url,user,pass);
var ps = dbConn.prepareStatement('SELECT * FROM whatever');
var rs = ps.executeQuery();

while(rs.next())
	list.add(rs.getString('somecolumn'));

rs.close();
ps.close();
dbConn.close();

return list;
And with a Database Reader in JavaScript mode:

Code:
importPackage(java.sql);
var dbConn = DriverManager.getConnection(url,user,pass);
var ps = dbConn.prepareStatement('SELECT * FROM whatever');
var rs = ps.executeQuery();
var crs = new com.sun.rowset.CachedRowSetImpl();
crs.populate(rs);

rs.close();
ps.close();
dbConn.close();

return crs;
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote