Home > Database > Mysql Tutorial > body text

mysql-SSH连接数据库时,无法自动创建表,且tomcat无法启动

WBOY
Release: 2016-06-06 09:41:37
Original
1229 people have browsed it

mysqltomcatjavassh

jdbc配置:
driverClass=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/mydata
user=root
password=root

<code>当数据库中没有mydata表时,无法自动创建,且tomcat启动不了,停留在Initializing Spring root WebApplicationContext。如果手动创建mydata表,tomcat可以启动,项目也能运行。hibernate配置:</code>
Copy after login


<code>    <!-- 数据库言 -->    <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>    <!-- 加载二级缓存插件(可选) -->    <property name="hibernate.cache.region.factory_class">org.hibernate.cache.EhCacheRegionFactory</property>    <property name="hibernate.cache.use_query_cache">true</property>    <!-- 配置自动生成DDL语句 -->    <property name="hibernate.hbm2ddl.auto">update</property>    <!-- 在控制台打印出当前的sql语句 -->    <property name="hibernate.show_sql">true</property>    <!-- 注册对象关系映射 --></code>
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template