求助:eclipse+tomcat连接数据库!!!!!

求助:eclipse+tomcat连接数据库!!!!!,第1张

String url="jdbc:mysql:3306//localhost/"+dbName+"

不对称啊,双引号错误

String literal is not properly closed by a double-quote

数据库连接池,需配置xml

<Context>

<Resource

name="jdbc/testJwc"

type="javax.sql.DataSource"

driverClassName="com.mysql.jdbc.Driver"

maxIdle="1000"

maxWait="5000"

url="jdbc:mysql://localhost:8080/testJwc?characterEncoding=utf-8"

maxActive="30"/>

</Context>

name="jdbc/testJwc"

指我们在调用的时所使用的名字

需要将驱动包导入到工程路径下:

你的项目右键>properties--->java build path, 点击【Add Jars】选择你的数据库驱动包

然后重新编译你的工程即可。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/10058042.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-04
下一篇2023-05-04

发表评论

登录后才能评论

评论列表(0条)

    保存