Thursday, June 26, 2014
Monday, June 23, 2014
Execute DB query from scheduled task or event handlers
we can execute sql queries from scheduled task/ eventhandler using getOperationalDS method.
API Reference:
http://docs.oracle.com/cd/E27559_01/apirefs.1112/e28159/oracle/iam/platform/Platform.html
Sample code to fetch data from DB:
String query="sqlquery -select usr_login from usr ";
Connection con=Platform.getOperationalDS().getConnection();
Statement st=con.prepareStatement(query);
ResultSet rs=st.executeQuery();
while(rs.next()){
String usrLogin=rs.getString("usr_login");
}
API Reference:
http://docs.oracle.com/cd/E27559_01/apirefs.1112/e28159/oracle/iam/platform/Platform.html
Sample code to fetch data from DB:
String query="sqlquery -select usr_login from usr ";
Connection con=Platform.getOperationalDS().getConnection();
Statement st=con.prepareStatement(query);
ResultSet rs=st.executeQuery();
while(rs.next()){
String usrLogin=rs.getString("usr_login");
}
Subscribe to:
Posts (Atom)