hello.
Could someone tell me what I need to change to get the initial contcext for my JDesktopApp?
public JDBCSchoolofdbDAO() {
try {
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup(
ModelUtils.getResource("JavaCompEnv"));
dataSource = (DataSource) envCtx.lookup(
ModelUtils.getResource("DataSource"));
} catch (NamingException x) {
ModelUtils.log(x);
throw new InternalError(x.getMessage());
}
}
private void close(Connection conn, PreparedStatement ps)
throws SQLException {
if (ps != null) {
ps.close();
}
if (conn != null) {
conn.close();
}
}
DAO=schoolAppModel.dao.JDBCSchoolofdbDAO
JavaCompEnv=java:comp/env
DataSource=jdbc:mysql://localhost:3306/schoolofdb
user=root
password=x