from shenluyuannet.dbo.admin admin0_
from的语法是:数据库名.表名,也就是最多只能有一个点,你检查一下你究竟需要查哪个数据库的哪个表,可能你有个.是其它符号。
无法创建请求服务,后面跟着jdbc环境问题,hibernate的配置文件中关于数据库连接和配置的地方有问题。这是连接oracle的代码
<?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">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@172.28.144.110:1521:SHKRP1QA</property>
<property name="hibernate.connection.username">TP</property>
<property name="hibernate.connection.password">PSH#TP</property>
<mapping class="it.robot.po.User_infor"/>
<mapping resource="it/robot/po/user_hbm.xml"/>
</session-factory>
</hibernate-configuration>
这是连接mysql的配置文件代码
<?xml version="1.0" encoding="GBK" ?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://www.hibernate.org/dtd/hibernate-Configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.connection.url">
jdbc:mysql://localhost:3306/shopping
</property>
<property name="hibernate.connection.username">
root
</property>
<property name="hibernate.connection.password">
root
</property>
<property name="dialect">
org.hibernate.dialect.MySQLInnoDBDialect
</property>
<property name="show_sql">true</property>
<mapping resource="Newsss.hbm.xml"/>
</session-factory>
</hibernate-configuration>
其实 很有可能是你配置文件中没有配置数据库方言,你试试配置一下数据库方言
mysql的方言就是上面代码中
<property name="dialect">
org.hibernate.dialect.MySQLInnoDBDialect
</property>
oracle不用配置(正常情况下,如果不好用你也配置一下,去网上搜一下啊)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)