2011-4-29 12:51:17 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
2011-4-29 12:51:17 org.springframework.jdbc.support.SQLErrorCodesFactory <init>
信息: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
我现在是通过HibernateTemplate的save方法往数据库添加 记录,但是添加不成功、
控制台出现上面的信息。
是怎么回事?
数据插入不成功的原因有很多种。
把你写的 applicationContext.xml配置文件粘出来看看。
我在自己的电脑上就可以,到了公司就不行了。
我自己电脑上就可以保存,但在公司这儿就不行。
我电脑上用的mysql数据库,公司用个oracle。
oracle的数据类型和mysql不一样。
用hql不用考虑语法
自动处理的事务提交
建议用1.5的驱动。相当NB的驱动。
你好 我现在的jdk版本是 1.4的,所以用的是ojdbc14.jar
服务器oracle是10g, 客户端安装的是9i。不会影响吧?
<!-- 1,引用spring事物处理命名空间 -->
<!-- 2,配置事务管理器 -->
<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 3,配置事务增强事物通知 -->
<tx:advice transaction-manager="txManager" id="txadvice">
<tx:attributes>
<tx:method name="get*" read-only="true"/>
<tx:method name="find*" read-only="true"/>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="remove*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<!-- 4,配置切面 -->
<aop:config>
<aop:pointcut expression="execution(* com.accp.bm.service..*.*(..))" id="pointCut"/>
<aop:advisor advice-ref="txadvice" pointcut-ref="pointCut"/>
</aop:config>