hibernate 数据库问题

proxool连接池在spring.xml中的配置

<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName">
              <value>org.logicalcobwebs.proxool.ProxoolDriver</value>
        </property>
        <property name="url"> <value>proxool.shopping</value> </property>
  </bean>
 

proxool.xml配置

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE proxool-config>
<proxool-config>
 <proxool>
  <alias>shopping</alias>      //别名,与spring.xml对应
  <driver-url>jdbc:mysql://127.0.0.1:3306/shopping2?characterEncoding=UTF-8</driver-url>//shopping2是数据库名
  <driver-class>com.mysql.jdbc.Driver</driver-class>
  <driver-properties>
   <property name="user" value="root" />       //mysql连接的连接名和用户名都行!!!
   <property name="password" value="" />
  </driver-properties>
  <house-keeping-sleep-time>60000</house-keeping-sleep-time>
  <maximum-connection-count>20</maximum-connection-count>
  <minimum-connection-count>2</minimum-connection-count>
  <prototype-count>0</prototype-count>
  <simultaneous-build-throttle>20</simultaneous-build-throttle>
  <house-keeping-test-sql>select CURRENT_DATE</house-keeping-test-sql>
 </proxool>
</proxool-config>


----------------------------------------------------------------------------------------------------------------

@Entity
@Table(name = "tbl_goods_type",      catalog = "shopping"  )//shopping是数据库名,可以与proxool.xml的连接不一    样,同个项目查询不同数据库的不同表。
public class GType implements java.io.Serializable {

 // Fields

 private Integer id;
 private Integer pid;
 private String typename;
 private String note;

你可能感兴趣的:(hibernate 数据库问题)