-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Query returns empty array when using ComboPooledDataSource
PostPosted: Tue Jun 24, 2008 1:37 pm 
Newbie

Joined: Tue Jun 24, 2008 1:21 pm
Posts: 1
I'm having a problem retrieving data from microsoft sql server 2005 when using ComboPooledDataSource.

When I use dbcp datasource it works fine but when i switch to use ComboPooledDataSource my query always returns empty. No error is given. My only change is in swapping the use of a ComboPooledDataSource to a dbcp BasicDataSource.

Below is my configuration. Any suggestions on what i may be doing wrong?



<bean id="DataSourceBeanId" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass"><value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value></property>
<property name="jdbcUrl"><value>jdbc:sqlserver://localhost:1433;databaseName=Test</value></property>
<property name="user"><value>sqluser</value></property>
<property name="password"><value>sqluser</value></property>
</bean>

<bean id="HibernatePropertiesBeanId" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
</bean>


<bean id="SessionFactoryBeanId" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource"><ref bean="DataSourceBeanId"/></property>
<property name="hibernateProperties"><ref bean="HibernatePropertiesBeanId" /></property>

<property name="mappingResources">
<list>
<value>User.hbm.xml</value>
</list>
</property>
</bean>


<bean id="TxManagerBeanId" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="SessionFactoryBeanId" />
</bean>
<tx:annotation-driven transaction-manager="TxManagerBeanId"/>


<bean id="DbcpDataSourceId" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value>
</property>
<property name="url">
<value>jdbc:sqlserver://localhost:1433;databaseName=SampleISF</value>
</property>
<property name="username"><value>sa</value></property>
<property name="password"><value>sasqluser</value></property>
</bean>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.