http://localhost:8888/看帮助
看server.xml如果配置正确,可以写代码了:
public static Connection getConn() {
Connection con = null;
try {
InitialContext ctx=new InitialContext();
DataSource ds=(DataSource)ctx.lookup("java:comp/env/jdbc/cohabit");
con = ds.getConnection();
//ctx.close();
return con;
}
catch (Exception e) {
System.out.println(e.toString());
return con;
}
finally{
}
}
看server.xml如果配置正确,可以写代码了:
public static Connection getConn() {
Connection con = null;
try {
InitialContext ctx=new InitialContext();
DataSource ds=(DataSource)ctx.lookup("java:comp/env/jdbc/cohabit");
con = ds.getConnection();
//ctx.close();
return con;
}
catch (Exception e) {
System.out.println(e.toString());
return con;
}
finally{
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货