链接数据库的配置文件
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>
<session-factory>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/zoodb
</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="show_sql">true</property>
<property name="c3p0.max_size">20</property>
<property name="c3p0.min_size">2</property>
<property name="c3p0.timeout">120</property>
<property name="c3p0.max_statements">100</property>
<property name="c3p0.idle_test_period">120</property>
<property name="c3p0.acquire_increment">2</property>
<property name="myeclipse.connection.profile">mysql</property>
<mapping resource="com/zoo/bean/system/Users.hbm.xml" />
<mapping resource="com/zoo/bean/system/Role.hbm.xml" />
<mapping resource="com/zoo/bean/system/Tright.hbm.xml" />
<mapping resource="com/zoo/bean/system/RoleTright.hbm.xml" />
<mapping resource="com/zoo/bean/system/UsersType.hbm.xml" />
<!-- 售票实体类 -->
<mapping resource="com/zoo/bean/ticket/Part.hbm.xml" />
<mapping resource="com/zoo/bean/ticket/PlayInfo.hbm.xml" />
<mapping resource="com/zoo/bean/ticket/Project.hbm.xml" />
<mapping resource="com/zoo/bean/ticket/SaleTarget.hbm.xml" />
<mapping resource="com/zoo/bean/ticket/Site.hbm.xml" />
<mapping resource="com/zoo/bean/ticket/Ticket.hbm.xml" />
<mapping resource="com/zoo/bean/ticket/TicketType.hbm.xml" />
</session-factory>
</hibernate-configuration>
---------------------------------------------------------------------------------------------------------------------
运行tomcat之后打开网页报错
ttp status: 500 Internal Server Error
ajaxOptions: error
thrownError: Internal Server Error
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; SQL [select tickettype0_.id as col_0_0_, (select project1_.pname from baobi.project project1_ where project1_.id=tickettype0_.project_id) as col_1_0_, tickettype0_.id as id11_, tickettype0_.type_name as type2_11_, tickettype0_.code as code11_, tickettype0_.price as price11_, tickettype0_.ticket_valid as ticket5_11_, tickettype0_.project_id as project6_11_, tickettype0_.do_user as do7_11_, tickettype0_.do_time as do8_11_, tickettype0_.rate as rate11_, tickettype0_.is_team as is10_11_ from baobi.ticket_type tickettype0_]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
---------------------------------------------------------------------------------------------------------------------------------------------------------
myeclipse当中后台运行时显示的数据库语句
Hibernate: select tickettype0_.id as col_0_0_, (select project1_.pname from baobi.project project1_ where project1_.id=tickettype0_.project_id) as col_1_0_, tickettype0_.id as id11_, tickettype0_.type_name as type2_11_, tickettype0_.code as code11_, tickettype0_.price as price11_, tickettype0_.ticket_valid as ticket5_11_, tickettype0_.project_id as project6_11_, tickettype0_.do_user as do7_11_, tickettype0_.do_time as do8_11_, tickettype0_.rate as rate11_, tickettype0_.is_team as is10_11_ from baobi.ticket_type tickettype0_
请看见帖子的大神给回复一下,还需要什么我将会在下面的回复中贴出来!
比较着急
------解决思路----------------------
你这里不是链接的zoodb数据库吗
------解决思路----------------------
<class name="com.zoo.bean.ticket.TicketType" table="ticket_type" catalog="baobi" schema="XXX">
schema="xxx"指定是这个数据库下的哪个用户下的表