当前位置: 代码迷 >> Java Web开发 >> MyEclipse+Hibernate连接MSSQL数据库总是could not execute query
  详细解决方案

MyEclipse+Hibernate连接MSSQL数据库总是could not execute query

热度:1193   发布时间:2007-07-17 09:26:20.0
MyEclipse+Hibernate连接MSSQL数据库总是could not execute query

使用MyEclipse自带的Hibernate插件功能尝试连接MSSQL数据库
<?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="myeclipse.connection.profile">con_denglu</property>
<property name="connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>
<property name="connection.url">jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=ChinaSpace</property>
<property name="connection.username">sa</property>
<property name="connection.password">123</property>
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>

<property name="show_sql">false</property>
执行的时候报错:
org.apache.jasper.JasperException: Exception forwarding for name indexToMain: javax.servlet.ServletException: could not execute query
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

搜索更多相关主题的帖子: Hibernate  MyEclipse  数据库  MSSQL  execute  

----------------解决方案--------------------------------------------------------
我以前也经常碰到这个问题``
但是我不太记得是什么原因引发的
` 不过这个异常可以有很多的东西引发``
你这个异常的关键是 Exception forwarding for name indexToMain 这个东西
----------------解决方案--------------------------------------------------------
下载 安装补丁了没有!
----------------解决方案--------------------------------------------------------
indexToMain 检查action里面的forwarding
----------------解决方案--------------------------------------------------------
  相关解决方案