SSH框架的数据库怎么连接 5
2个回答
展开全部
spring的配置方式:
<bean id="ds" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"></property>
<property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl"></property>
<核梁property name="username" value="system"></property>
<property name="password" value="system"></property>
</bean>
hibernat的配置方式:
<session-factory>
<property name="hibernate.connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="hibernate.connection.url">
jdbc:oracle:thin:@localhost:1521:orcl
</渣锋property>
<property name="hibernate.connection.username">scott</property>
<property name="hibernate.connection.password">hyh</property>
<property name="dialect">
org.hibernate.dialect.Oracle10gDialect
</property>
<property name="如氏晌show_sql">true</property>
<property name="hbm2ddl.auto">update</property>
<mapping resource="com/hyh/bean/beans.hbm.xml" />
</session-factory>
<bean id="ds" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"></property>
<property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl"></property>
<核梁property name="username" value="system"></property>
<property name="password" value="system"></property>
</bean>
hibernat的配置方式:
<session-factory>
<property name="hibernate.connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="hibernate.connection.url">
jdbc:oracle:thin:@localhost:1521:orcl
</渣锋property>
<property name="hibernate.connection.username">scott</property>
<property name="hibernate.connection.password">hyh</property>
<property name="dialect">
org.hibernate.dialect.Oracle10gDialect
</property>
<property name="如氏晌show_sql">true</property>
<property name="hbm2ddl.auto">update</property>
<mapping resource="com/hyh/bean/beans.hbm.xml" />
</session-factory>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询