Is it possible to reach SFSDBManager from any native java class.
Detailed example is below
Code: Select all
public class DbConnect
{
public DbConnect() {
Connection conn;
PreparedStatement stmt;
public String SomeMethod() {
String res = "";
try {
sql = "SELECT * FROM table";
conn = getParentZone().getDBManager().getConnection();
stmt = conn.prepareStatement(sql);
ResultSet resultSet = stmt.executeQuery();
}
catch (SQLException) {
}
finally{
if (stmt != null)
stmt.close();
if (conn != null)
conn.close();
}
return res;
}
}
}