ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject Re: Trouble with SQL SERVER 2005
Date Thu, 14 May 2009 20:14:51 GMT
Make the following change below and give it a try.

  <resultMap id="RegionResult" class="myapp.models.Region">
    <result property="regionId" column="region_id"/>
    <result property="regionName" column="region_name"/>
  </resultMap>
  
    <select id="selectAllRegion" resultMap="RegionResult">
        select region_id,region_name from Region 
    </select>
</sqlMap>






Abdel Olakara <olakara@gmail.com> 
05/14/2009 12:29 PM
Please respond to
user-java@ibatis.apache.org


To
user-java@ibatis.apache.org
cc

Subject
Trouble with SQL SERVER 2005







Hi all,

 I am using Sql server 2005 with iBATIS in my project. I am using 
Microsoft provided driver for my connectivity..here is my sqlMapConfig 
file: 

<sqlMapConfig>


  <transactionManager type="JDBC" commitRequired="false">
    <dataSource type="SIMPLE">
      <property name="JDBC.Driver" 
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
      <property name="JDBC.ConnectionURL" 
value="jdbc:sqlserver://localhost:5356;databaseName=testdb"/>
      <property name="JDBC.Username" value="sam"/>
      <property name="JDBC.Password" value="sam"/>
      <property name="JDBC.DefaultAutoCommit" value="true" />
    </dataSource>
  </transactionManager>

  <sqlMap resource="myapp/models/Population.xml"/>
  <sqlMap resource="myapp/models/Region.xml"/>
</sqlMapConfig>

There is no error as such in connecting and querying but the values are 
not populated into the bean. here is my region.xml

<sqlMap namespace="Region">

  <resultMap id="RegionResult" class="myapp.models.Region">
    <result property="regionId" column="region_id"/>
    <result property="regionName" column="region_name"/>
  </resultMap>
  
    <select id="selectAllRegion" resultClass="myapp.models.Region">
        select region_id,region_name from Region 
    </select>
</sqlMap>

both reagion_id and region_name populated in the bean is null values.. 
where as.. for my other object ir Population,  population_id comes up but 
other values are null.
The values are available in DB and normal JDBC programming can retrive the 
values.

Can anybody give me a solution?

Thanks in advance,
-- 
Best Regrads,
Abdel Raoof Olakara
olakara@gmail.com
http://technopaper.blogspot.com

Mime
View raw message