错误信息
org.apache.jasper.JasperException: net.sf.hibernate.exception.SQLGrammarException: Could not execute query
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause java.lang.RuntimeException: net.sf.hibernate.exception.SQLGrammarException: Could not execute query
com.xiebing.Hibernate.VipService.getVipdataList(VipService.java:95)
org.apache.jsp.AddVipData_jsp._jspService(AddVipData_jsp.java:118)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
vipdata.hbm.xml
<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Mon Dec 12 19:04:58 CST 2005 -->
<hibernate-mapping package="com.xiebing.Hibernate"> <class name="Vipdata" table="vipdata">
<id name="vipid" column="vipId" type="java.lang.Integer">
<generator class="native"/>
</id>
<property name="vipname" column="vipName" type="java.lang.String" not-null="true" />
<property name="viptitle" column="vipTitle" type="java.lang.String" not-null="true" />
</class>
</hibernate-mapping>
abstractVipdata.java
/*
* WARNING: DO NOT EDIT THIS FILE. This is a generated file that is synchronized
* by MyEclipse Hibernate tool integration.
*
* Created Mon Dec 12 19:04:58 CST 2005 by MyEclipse Hibernate Tool.
*/
package com.xiebing.Hibernate;import java.io.Serializable;/**
* A class that represents a row in the vipdata table.
* You can customize the behavior of this class by editing the class, {@link Vipdata()}.
* WARNING: DO NOT EDIT THIS FILE. This is a generated file that is synchronized * by MyEclipse Hibernate tool integration.
*/
public abstract class AbstractVipdata
implements Serializable
{
/** The cached hash code value for this instance. Settting to 0 triggers re-calculation. */
private int hashValue = 0; /** The composite primary key value. */
private java.lang.Integer vipid; /** The value of the simple vipname property. */
private java.lang.String vipname; /** The value of the simple viptitle property. */
private java.lang.String viptitle; /**
* Simple constructor of AbstractVipdata instances.
*/
public AbstractVipdata()
{
} /**
* Constructor of AbstractVipdata instances given a simple primary key.
* @param vipid
*/
public AbstractVipdata(java.lang.Integer vipid)
{
this.setVipid(vipid);
} /**
* Return the simple primary key value that identifies this object.
* @return java.lang.Integer
*/
public java.lang.Integer getVipid()
{
return vipid;
} /**
* Set the simple primary key value that identifies this object.
* @param vipid
*/
public void setVipid(java.lang.Integer vipid)
{
this.hashValue = 0;
this.vipid = vipid;
} /**
* Return the value of the vipName column.
* @return java.lang.String
*/
public java.lang.String getVipname()
{
return this.vipname;
} /**
* Set the value of the vipName column.
* @param vipname
*/
public void setVipname(java.lang.String vipname)
{
this.vipname = vipname;
} /**
* Return the value of the vipTitle column.
* @return java.lang.String
*/
public java.lang.String getViptitle()
{
return this.viptitle;
} /**
* Set the value of the vipTitle column.
* @param viptitle
*/
public void setViptitle(java.lang.String viptitle)
{
this.viptitle = viptitle;
} /**
* Implementation of the equals comparison on the basis of equality of the primary key values.
* @param rhs
* @return boolean
*/
public boolean equals(Object rhs)
{
if (rhs == null)
return false;
if (! (rhs instanceof Vipdata))
return false;
Vipdata that = (Vipdata) rhs;
if (this.getVipid() != null && that.getVipid() != null)
{
if (! this.getVipid().equals(that.getVipid()))
{
return false;
}
}
return true;
} /**
* Implementation of the hashCode method conforming to the Bloch pattern with
* the exception of array properties (these are very unlikely primary key types).
* @return int
*/
public int hashCode()
{
if (this.hashValue == 0)
{
int result = 17;
int vipidValue = this.getVipid() == null ? 0 : this.getVipid().hashCode();
result = result * 37 + vipidValue;
this.hashValue = result;
}
return this.hashValue;
}
}
vipdata.java
/*
* Created Mon Dec 12 16:53:00 CST 2005 by MyEclipse Hibernate Tool.
*/
package com.xiebing.Hibernate;import java.io.Serializable;/**
* A class that represents a row in the 'vipdata' table.
* This class may be customized as it is never re-generated
* after being created.
*/
public class Vipdata
extends AbstractVipdata
implements Serializable
{
/**
* Simple constructor of Vipdata instances.
*/
public Vipdata()
{
}
/*private Integer vipid;
private String vipname;
private String viptitle;
public Integer getVipid(){
return vipid;
}
public String getVipname(){
return vipname;
}
public String getViptitle(){
return viptitle;
}
public void setVipid(){
this.vipid=vipid;
}
public void setVipname(){
this.vipname=vipname;
}
public void setViptitle(){
this.viptitle=viptitle;
}*/
/**
* Constructor of Vipdata instances given a simple primary key.
* @param vipid
*/
public Vipdata(java.lang.Integer vipid)
{
super(vipid);
} /* Add customized code below */}
hibernate.cfg.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"><!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<hibernate-configuration> <session-factory>
<!-- properties -->
<property name="connection.username">sa</property>
<property name="connection.url">jdbc:microsoft:sqlserver://localhost:1433;database=test</property>
<property name="dialect">net.sf.hibernate.dialect.SQLServerDialect</property>
<property name="connection.password">sa</property>
<property name="connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property> <!-- mapping files -->
<mapping resource="com/xiebing/Hibernate/Vipdata.hbm.xml"/> </session-factory></hibernate-configuration>
请各位大哥帮忙 一定及时给分
org.apache.jasper.JasperException: net.sf.hibernate.exception.SQLGrammarException: Could not execute query
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause java.lang.RuntimeException: net.sf.hibernate.exception.SQLGrammarException: Could not execute query
com.xiebing.Hibernate.VipService.getVipdataList(VipService.java:95)
org.apache.jsp.AddVipData_jsp._jspService(AddVipData_jsp.java:118)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
vipdata.hbm.xml
<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Mon Dec 12 19:04:58 CST 2005 -->
<hibernate-mapping package="com.xiebing.Hibernate"> <class name="Vipdata" table="vipdata">
<id name="vipid" column="vipId" type="java.lang.Integer">
<generator class="native"/>
</id>
<property name="vipname" column="vipName" type="java.lang.String" not-null="true" />
<property name="viptitle" column="vipTitle" type="java.lang.String" not-null="true" />
</class>
</hibernate-mapping>
abstractVipdata.java
/*
* WARNING: DO NOT EDIT THIS FILE. This is a generated file that is synchronized
* by MyEclipse Hibernate tool integration.
*
* Created Mon Dec 12 19:04:58 CST 2005 by MyEclipse Hibernate Tool.
*/
package com.xiebing.Hibernate;import java.io.Serializable;/**
* A class that represents a row in the vipdata table.
* You can customize the behavior of this class by editing the class, {@link Vipdata()}.
* WARNING: DO NOT EDIT THIS FILE. This is a generated file that is synchronized * by MyEclipse Hibernate tool integration.
*/
public abstract class AbstractVipdata
implements Serializable
{
/** The cached hash code value for this instance. Settting to 0 triggers re-calculation. */
private int hashValue = 0; /** The composite primary key value. */
private java.lang.Integer vipid; /** The value of the simple vipname property. */
private java.lang.String vipname; /** The value of the simple viptitle property. */
private java.lang.String viptitle; /**
* Simple constructor of AbstractVipdata instances.
*/
public AbstractVipdata()
{
} /**
* Constructor of AbstractVipdata instances given a simple primary key.
* @param vipid
*/
public AbstractVipdata(java.lang.Integer vipid)
{
this.setVipid(vipid);
} /**
* Return the simple primary key value that identifies this object.
* @return java.lang.Integer
*/
public java.lang.Integer getVipid()
{
return vipid;
} /**
* Set the simple primary key value that identifies this object.
* @param vipid
*/
public void setVipid(java.lang.Integer vipid)
{
this.hashValue = 0;
this.vipid = vipid;
} /**
* Return the value of the vipName column.
* @return java.lang.String
*/
public java.lang.String getVipname()
{
return this.vipname;
} /**
* Set the value of the vipName column.
* @param vipname
*/
public void setVipname(java.lang.String vipname)
{
this.vipname = vipname;
} /**
* Return the value of the vipTitle column.
* @return java.lang.String
*/
public java.lang.String getViptitle()
{
return this.viptitle;
} /**
* Set the value of the vipTitle column.
* @param viptitle
*/
public void setViptitle(java.lang.String viptitle)
{
this.viptitle = viptitle;
} /**
* Implementation of the equals comparison on the basis of equality of the primary key values.
* @param rhs
* @return boolean
*/
public boolean equals(Object rhs)
{
if (rhs == null)
return false;
if (! (rhs instanceof Vipdata))
return false;
Vipdata that = (Vipdata) rhs;
if (this.getVipid() != null && that.getVipid() != null)
{
if (! this.getVipid().equals(that.getVipid()))
{
return false;
}
}
return true;
} /**
* Implementation of the hashCode method conforming to the Bloch pattern with
* the exception of array properties (these are very unlikely primary key types).
* @return int
*/
public int hashCode()
{
if (this.hashValue == 0)
{
int result = 17;
int vipidValue = this.getVipid() == null ? 0 : this.getVipid().hashCode();
result = result * 37 + vipidValue;
this.hashValue = result;
}
return this.hashValue;
}
}
vipdata.java
/*
* Created Mon Dec 12 16:53:00 CST 2005 by MyEclipse Hibernate Tool.
*/
package com.xiebing.Hibernate;import java.io.Serializable;/**
* A class that represents a row in the 'vipdata' table.
* This class may be customized as it is never re-generated
* after being created.
*/
public class Vipdata
extends AbstractVipdata
implements Serializable
{
/**
* Simple constructor of Vipdata instances.
*/
public Vipdata()
{
}
/*private Integer vipid;
private String vipname;
private String viptitle;
public Integer getVipid(){
return vipid;
}
public String getVipname(){
return vipname;
}
public String getViptitle(){
return viptitle;
}
public void setVipid(){
this.vipid=vipid;
}
public void setVipname(){
this.vipname=vipname;
}
public void setViptitle(){
this.viptitle=viptitle;
}*/
/**
* Constructor of Vipdata instances given a simple primary key.
* @param vipid
*/
public Vipdata(java.lang.Integer vipid)
{
super(vipid);
} /* Add customized code below */}
hibernate.cfg.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"><!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<hibernate-configuration> <session-factory>
<!-- properties -->
<property name="connection.username">sa</property>
<property name="connection.url">jdbc:microsoft:sqlserver://localhost:1433;database=test</property>
<property name="dialect">net.sf.hibernate.dialect.SQLServerDialect</property>
<property name="connection.password">sa</property>
<property name="connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property> <!-- mapping files -->
<mapping resource="com/xiebing/Hibernate/Vipdata.hbm.xml"/> </session-factory></hibernate-configuration>
请各位大哥帮忙 一定及时给分
看一下你的VipService.java李牵扯到查询的语句。
很有可能问题在这啊。你现在贴出来的文件基本上没问题哈。