真么是这样连的呢? 要用jndi,datasourceInitialContext initCtx = null; try { initCtx = new InitialContext(); DataSource ds = (javax.sql.DataSource) initCtx.lookup("java:comp/env/jdbc/demoPool"); return ds.getConnection(); } catch(NamingException ne) { log("Failed to lookup JDBC Datasource. Please double check that"); log("the JNDI name defined in the resource-description of the "); log("EJB's weblogic-ejb-jar.xml file is the same as the JNDI name "); log("for the Datasource defined in your config.xml."); } finally { try { if(initCtx != null) initCtx.close(); } catch(NamingException ne) { log("Error closing context: " + ne); throw new EJBException(ne); } }
难道不能在JBuilder中用WebLogic吗?
要用,你得先启动weblogic服务!!!
我已经启动了WebLogic6.1,并且一切正常,只是提示我 <Application Poller not started for production server.>
要用jndi,datasourceInitialContext initCtx = null;
try {
initCtx = new InitialContext();
DataSource ds = (javax.sql.DataSource)
initCtx.lookup("java:comp/env/jdbc/demoPool");
return ds.getConnection();
} catch(NamingException ne) {
log("Failed to lookup JDBC Datasource. Please double check that");
log("the JNDI name defined in the resource-description of the ");
log("EJB's weblogic-ejb-jar.xml file is the same as the JNDI name ");
log("for the Datasource defined in your config.xml.");
} finally {
try {
if(initCtx != null) initCtx.close();
} catch(NamingException ne) {
log("Error closing context: " + ne);
throw new EJBException(ne);
}
}
<Application Poller not started for production server.>