Results 1 to 5 of 5

Thread: ibatis connection and configuration

  1. #1
    Join Date
    Dec 2007
    Posts
    1

    Default ibatis connection and configuration

    Hi Gurus,
    I am very new to ibatis. I know the concept that sql-map-config for sql statement and object. So that

    1) qlMapClient.startTransaction();

    2) sqlMapClient.startBatch();

    3) sqlMapClient.update("action_id_in_map-sql-confix.xml", pojo);

    4) sqlMapClient.executeBatch();

    5) sqlMapClient.commitTransaction();

    But I don't know how to configure to get the data source or whatever for sqlMapClient. I don't what to use pojoDAO because I don't know how to use it. Can someone show me step by step how to configure and code to obtain sqlMapClient. Thank you very much.

    J.

  2. #2

    Default

    The post seems more appropriate for Ibatis forum rather than Spring Batch. If you want to use Ibatis with Spring Batch, check the sample ibatisJob.xml

  3. #3
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    I agree with Robert, this probably belongs in another forum. However, I just wanted to add that iBatis can be used as an ItemReader, but that a different class than the SqlMapClient will need to be used. It is essentially a DrivingQueryItemReader with an iBatisKeyGenerator.

    For output, you should be able to follow standard spring patterns:

    http://static.springframework.org/sp...tml#orm-ibatis

  4. #4
    Join Date
    Aug 2007
    Posts
    9

    Default "Optional features not implemented" Error in Spring-Ibatis-MS Access application

    Hi
    I am developing an application using Spring Framework with Ibatis for ORM and MS Access as Database. The application starts by displaying a login screen and after verifying the correct user name and password, the user is directed toward another JSP. The following error is encountered when the user enters Name and Password :" Optional features not Implemented".
    My web.xml has the code
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <servlet>
    <servlet-name>action</servlet-name>
    <display-name>action</display-name>
    <servlet-class>
    org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.html</url-pattern>
    </servlet-mapping>

    </web-app>

    My action-servlet has the code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

    <beans>
    <bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <props>
    <!-- keys for my work view -->
    <prop key="/hewitt.html">hewittController</prop>
    </props>
    </property>
    </bean>



    <bean id="hewittAssociateDao" class="com.hello.connectivity.hewittAssociate.Hewi ttAssociateDaoIbatis">
    <property name="sqlMapClient" ref="sqlMapConfig" />
    <property name="dataSource"><ref local="testDataSource"/></property>

    </bean>
    <bean id="loginManager" class="com.hello.service.LoginManagerImpl">
    <property name="hewittAssociateDao" ref="hewittAssociateDao" />
    </bean>
    <bean id="hewittController" class="com.hello.web.associateController.HewittAss ociateController">
    <property name="loginManager" ref="loginManager" />
    </bean>
    <bean id="testDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName">
    <value>sun.jdbc.odbc.JdbcOdbcDriver</value>
    </property>
    <property name="url">
    <value>jdbc:odbc:ASSOCIATE</value>
    </property>
    <property name="username">
    <value></value>
    </property>
    <property name="password">
    <value></value>
    </property>
    </bean>

    <bean id="sqlMapConfig" class="org.springframework.orm.ibatis.SqlMapClient FactoryBean">
    <property name="configLocation">
    <value>classpath:com/hello/connectivity/sqlMaps/sqlMapConfig.xml</value>
    </property>
    </bean>

    </beans>

    Please guide me through where the error can be.

  5. #5

    Default

    Please post to Spring core forum, this forum is devoted to *Spring Batch*

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •