ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Maves" <nathan.ma...@gmail.com>
Subject Re: problem with simple <result ... select=../>
Date Mon, 23 Apr 2007 14:48:42 GMT
you might want to post your spring config file where you configure your
datasource and sqlmap clients.

Here is what I use.


        <bean id="propertyConfigurer" class="
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
            <property name="location" value="classpath:database.properties
"/>
        </bean>

    <bean id="dataSource"
        class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close">
        <property name="driverClassName" value="${driver}" />
        <property name="url" value="${url}" />
        <property name="username" value="${username}" />
        <property name="password" value="${password}" />
    </bean>

    <bean id="sqlMapClient"
          class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="configLocation"
                  value="classpath:ibatis.xml" />
        <property name="dataSource" ref="dataSource" />
        <property name="useTransactionAwareDataSource" value="true" />
    </bean>

On 4/20/07, andreafey <andrea.fey@noaa.gov> wrote:
>
>
> I am in the process of upgrading to Spring 2.0.4 from 1.2.8 and began with
> an
> upgrade to Ibatis (from 2.x to 2.3.0). All of my DAOs were injected with
> the
> datasource, and the nested select worked before the upgrade. This fixed
> the
> introduced NPE.
> Thanks,
> Andrea
>
>
> Mike_ wrote:
> >
> > Found the problem, and posting it just in case another newbie runs into
> > it.
> >
> > By habit I injected the datasource into my DAO's( in the spring
> > configuration), which is a big nono. When only injecting the datasource
> > into
> > the sql map client it all works fine.
> >
>
> --
> View this message in context:
> http://www.nabble.com/problem-with-simple-%3Cresult-...-select%3D..-%3E-tf3492459.html#a10102921
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Mime
View raw message