Hi,
I am new on CAF.
Instead of using database connector, which is no much flexible for the query statement. I want to build a dynamic query against Oracle database, and display result in a table on view.
I would like to write a following code in Designer, and binding the result with table in view.
try{
Class.forName(“oracle.jdbc.driver.OracleDriver”);
String url=“jdbc:oracle:thin:@localhost:1521:OracleDB”;
Connection connection = DriverManager.getConnection(url, “user”, password");
Statement stmt=connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
rs=stmt.executeQuery(“SELECT * FROM tbl_Employee”);
}
catch(SQLException e){}
catch(ClassNotFoundException e){}
return rs;
}
Is it a correct approach?
Thanks,
Shuren