×

Loading...

VAJ3.5. I use the following codes to retrieve the jdbcURL. But it doesn't work. The return value of url is always "null". Help!

VAJ3.5. I use the following codes to retrieve the jdbcURL. But it doesn't work. The return value of url is always "null".

Connection getConnection() throws SQLException{
Properties props = context.getEnvironment(); //context is defined in beanclass as: EntityContext context = null
String url = props.getProperty("jdbcURL");
return DriverManager.getConnection(url);
// if I define url explicitly as: String url = "jdbc:db2:sample"; work well!
}
Report