DataSource ds= (DataSource)ctx.lookup("java:comp/env/jdbc/bookstore");
这句连接是后老是出现错误。
谁能讲解下java:comp/env/jdbc/bookstore都是什么。有什么关系 <Content>
<Resource name = "jdbc/bookstore" auth = "Container"
type = "javax.sql.DataSource" maxActive = "100" maxIdle = "30" maxWait = "10000"
username = "root" password = "root"
driverClassName = "com.mysql.jdbc.Driver"
url = "jdbc:mysql://localhost:3306/bookstore?autoReconnect=true"/>
</Content>在本工程目录META-INF 的 content.xml文件