<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Live To Code</title>
	<atom:link href="http://snowjunkiedev.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://snowjunkiedev.wordpress.com</link>
	<description>Wake up.  It&#039;s just a job.  There&#039;s more to life.</description>
	<lastBuildDate>Sat, 28 Nov 2009 01:02:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='snowjunkiedev.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Live To Code</title>
		<link>http://snowjunkiedev.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://snowjunkiedev.wordpress.com/osd.xml" title="Live To Code" />
	<atom:link rel='hub' href='http://snowjunkiedev.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Spring + iBatis // Oracle Ref Cursors</title>
		<link>http://snowjunkiedev.wordpress.com/2009/11/28/spring-ibatis-oracle-ref-cursors/</link>
		<comments>http://snowjunkiedev.wordpress.com/2009/11/28/spring-ibatis-oracle-ref-cursors/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 00:58:31 +0000</pubDate>
		<dc:creator>Alastair Vance</dc:creator>
				<category><![CDATA[iBATIS]]></category>
		<category><![CDATA[Java Language]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[OUT]]></category>
		<category><![CDATA[parameter]]></category>
		<category><![CDATA[REF CURSOR]]></category>

		<guid isPermaLink="false">http://snowjunkiedev.wordpress.com/?p=88</guid>
		<description><![CDATA[The previous iBatis example on this blog was for simple embedded SQL queries.  The following example is for using iBatis with Oracle stored procedures that have a REF CURSOR OUT parameter.  The code snippets below assume you have followed and understood the previous iBatis example, as they are build upon the same file structure. The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=88&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-1-libraries/" target="_self">previous iBatis example</a> on this blog was for simple embedded SQL queries.  The following example is for using iBatis with Oracle stored procedures that have a REF CURSOR OUT parameter.  The code snippets below assume you have followed and understood the previous iBatis example, as they are build upon the same file structure.</p>
<p>The cursor is declared in the Oracle package specification as:</p>
<pre>TYPE T_CURSOR IS REF CURSOR;</pre>
<p>The stored procedure I am using in this example is as follows:</p>
<pre>PROCEDURE GET_PICKUP_INSTRUCTIONS(IO_CURSOR OUT T_CURSOR) IS

 BEGIN

 OPEN IO_CURSOR FOR
 SELECT f.ID,
 f.ROOT_DIR,
 f.TARGET_DIR,
 f.INCLUDE_SUBDIRS,
 f.FILE_FILTER_LIST,
 f.PREFIX_TEXT,
 f.POSTFIX_TEXT,
 f.NEW_EXT,
 f.KEEP_UNIQUE,
 f.AUDIT_DB_PROPERTIES_FILE,
 f.DEL_SOURCE               
 FROM FILEPICKUP_CONFIG f;

 END GET_PICKUP_INSTRUCTIONS;</pre>
<p>The sqlMap entries should be as follows.  If you are continuing on from the <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-1-libraries/" target="_self">previous example</a>, you will already have the <strong><span style="color:#333399;">resultMap</span></strong> below setup.  If not, you will need to refer back and also create the FilePickup class.</p>
<pre>&lt;!-- map for result set based on table --&gt;
 &lt;resultMap id="result" class="<strong><span style="color:#333399;">com.example.FilePickup</span></strong>"&gt;
 &lt;result property="id" column="ID"/&gt;
 &lt;result property="root_dir" column="ROOT_DIR"/&gt;
 &lt;result property="target_dir" column="TARGET_DIR"/&gt;
 &lt;result property="include_subdirs" column="INCLUDE_SUBDIRS"/&gt;    
 &lt;result property="file_filter_list" column="FILE_FILTER_LIST"/&gt;
 &lt;result property="prefix_text" column="PREFIX_TEXT"/&gt;
 &lt;result property="postfix_text" column="POSTFIX_TEXT"/&gt;
 &lt;result property="new_ext" column="NEW_EXT"/&gt;
 &lt;result property="keep_unique" column="KEEP_UNIQUE"/&gt;
 &lt;result property="audit_db_properties_file" column="AUDIT_DB_PROPERTIES_FILE"/&gt;
 &lt;result property="del_source" column="DEL_SOURCE"/&gt;    
 &lt;/resultMap&gt;

 &lt;parameterMap id="getPickupInstructionsMap" class="<strong><span style="color:#333399;">java.util.Map</span></strong>"&gt;
 &lt;parameter property="<strong><span style="color:#333399;">IO_CURSOR</span></strong>" javaType="<strong><span style="color:#333399;">java.sql.ResultSet</span></strong>"
            jdbcType="<span style="color:#333399;"><strong>ORACLECURSOR</strong></span>" mode="OUT" /&gt;
 &lt;/parameterMap&gt;

 &lt;procedure id="getPickupInstructions"
            parameterMap="<strong><span style="color:#333399;">getPickupInstructionsMap</span></strong>"
            resultMap="<strong><span style="color:#333399;">result</span></strong>"&gt;
    {call PKG_FILE_PICKUP.GET_PICKUP_INSTRUCTIONS(?)}
 &lt;/procedure&gt;</pre>
<p>Add this declaration to your DAO interface:</p>
<pre>List&lt;FilePickupRM&gt; getPickupInstructions();</pre>
<p>In the DAO implementation class add the following method:</p>
<pre>public List&lt;FilePickupRM&gt; getPickupInstructions() {

 Map map = new HashMap();        
 return getSqlMapClientTemplate().queryForList("<strong><span style="color:#333399;">getPickupInstructions</span></strong>", map);

 }</pre>
<p>To execute the method use the following snippet of code.  Again, refer to <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-1-libraries/" target="_self">previous iBatis example</a> for defining the <strong><span style="color:#333399;">applicationContext.xml</span></strong> file.</p>
<pre>public static void main(String[] args) {

 ClassPathXmlApplicationContext ctx =
   new ClassPathXmlApplicationContext("<strong><span style="color:#333399;">applicationContext.xml</span></strong>");

 MyDAO dao = (MyDAO) ctx.getBean("myDAO");
 List&lt;FilePickupRM&gt; fp = dao.getPickupInstructions();

 for (FilePickupRM fps : fp) {
    System.out.println(fps);
 }

 ctx.close();

 }</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/snowjunkiedev.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/snowjunkiedev.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/snowjunkiedev.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/snowjunkiedev.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/snowjunkiedev.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/snowjunkiedev.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/snowjunkiedev.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/snowjunkiedev.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/snowjunkiedev.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/snowjunkiedev.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/snowjunkiedev.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/snowjunkiedev.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/snowjunkiedev.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/snowjunkiedev.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=88&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://snowjunkiedev.wordpress.com/2009/11/28/spring-ibatis-oracle-ref-cursors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/73c777bc3210189841f449968029a483?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">snowjunkie</media:title>
		</media:content>
	</item>
		<item>
		<title>Spring + iBatis // Part 7 // Executing a Method</title>
		<link>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-7-executing-a-method/</link>
		<comments>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-7-executing-a-method/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 20:39:28 +0000</pubDate>
		<dc:creator>Alastair Vance</dc:creator>
				<category><![CDATA[iBATIS]]></category>
		<category><![CDATA[Java Language]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[dao]]></category>
		<category><![CDATA[executing]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://snowjunkiedev.wordpress.com/?p=82</guid>
		<description><![CDATA[Ok, so you now have everything setup.  You have the libraries added, the database.properties file pointed properly, the applicationContext.xml file configured, the sql mappings file in place with the classes to support it, and the DAO interface implemented. Now you just want to execute it and see it working, right?  The snippet below will execute [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=82&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ok, so you now have everything setup.  You have the <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-1-libraries/" target="_self">libraries added</a>, the <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-2-database-properties/" target="_self">database.properties</a> file pointed properly, the <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-3-applicationcontext/" target="_self">applicationContext.xml</a> file configured, the <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-4-sqlmap-config/" target="_self">sql mappings file</a> in place with the <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-6-the-result-map-class/" target="_self">classes to support it</a>, and the <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-5-the-dao/" target="_self">DAO interface implemented</a>.</p>
<p>Now you just want to execute it and see it working, right?  The snippet below will execute the query to pull back a java.util.List.</p>
<pre>public static void main(String[] args) {

ClassPathXmlApplicationContext ctx =
 new ClassPathXmlApplicationContext("applicationContext.xml");

MyDAO dao = (MyDAO) ctx.getBean("myDAO");
List&lt;FilePickup&gt; fp = dao.selectFilepickupInstructions();

for (FilePickup fps : fp) {
 System.out.println(fps);
}

ctx.close();

}</pre>
<p>If you spot any errors, or have any questions about these steps, please feel free to leave a comment.  I can&#8217;t promise I will reply or have time to look into it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/snowjunkiedev.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/snowjunkiedev.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/snowjunkiedev.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/snowjunkiedev.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/snowjunkiedev.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/snowjunkiedev.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/snowjunkiedev.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/snowjunkiedev.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/snowjunkiedev.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/snowjunkiedev.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/snowjunkiedev.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/snowjunkiedev.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/snowjunkiedev.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/snowjunkiedev.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=82&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-7-executing-a-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/73c777bc3210189841f449968029a483?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">snowjunkie</media:title>
		</media:content>
	</item>
		<item>
		<title>Spring + iBatis // Part 6 // The Result Map Class</title>
		<link>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-6-the-result-map-class/</link>
		<comments>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-6-the-result-map-class/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 20:12:06 +0000</pubDate>
		<dc:creator>Alastair Vance</dc:creator>
				<category><![CDATA[iBATIS]]></category>
		<category><![CDATA[Java Language]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[resultMap]]></category>
		<category><![CDATA[sqlMap]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://snowjunkiedev.wordpress.com/?p=77</guid>
		<description><![CDATA[You may have noticed when creating the sqlMap details that we referenced a class that we were mapping the table to.  This class is just a simple class that has read/write class properties for each of the table columns we will be using. package com.example; public class FilePickup { private long id; private String root_dir; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=77&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You may have noticed when creating the <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-4-sqlmap-config/" target="_self">sqlMap details</a> that we referenced a class that we were mapping the table to.  This class is just a simple class that has read/write class properties for each of the table columns we will be using.</p>
<p><span id="more-77"></span></p>
<pre>package com.example;

public class FilePickup {

 private long id;
 private String root_dir;
 private String include_subdirs;
 private String target_dir;
 private String file_filter_list;
 private String prefix_text;
 private String postfix_text;
 private String new_ext;
 private String keep_unique;
 private String del_source;
 private String audit_db_properties_file;

 public FilePickup() {
 }

 public void setId(long id) {
  this.id = id;
 }

 public long getId() {
  return id;
 }

 public void setRoot_dir(String root_dir) {
  this.root_dir = root_dir;
 }

 public String getRoot_dir() {
  return root_dir;
 }

 public void setInclude_subdirs(String include_subdirs) {
  this.include_subdirs = include_subdirs;
 }

 public String getInclude_subdirs() {
  return include_subdirs;
 }

 public void setTarget_dir(String target_dir) {
  this.target_dir = target_dir;
 }

 public String getTarget_dir() {
  return target_dir;
 }

 public void setFile_filter_list(String file_filter_list) {
  this.file_filter_list = file_filter_list;
 }

 public String getFile_filter_list() {
  return file_filter_list;
 }

 public void setPrefix_text(String prefix_text) {
  this.prefix_text = prefix_text;
 }

 public String getPrefix_text() {
  return prefix_text;
 }

 public void setPostfix_text(String postfix_text) {
  this.postfix_text = postfix_text;
 }

 public String getPostfix_text() {
  return postfix_text;
 }

 public void setNew_ext(String new_ext) {
  this.new_ext = new_ext;
 }

 public String getNew_ext() {
  return new_ext;
 }

 public void setKeep_unique(String keep_unique) {
  this.keep_unique = keep_unique;
 }

 public String getKeep_unique() {
  return keep_unique;
 }

 public void setDel_source(String del_source) {
  this.del_source = del_source;
 }

 public String getDel_source() {
  return del_source;
 }

 public void setAudit_db_properties(String audit_db_properties_file) {
  this.audit_db_properties_file = audit_db_properties_file;
 }

 public String getAudit_db_properties() {
  return audit_db_properties_file;
 }

 public String toString() {
  return this.target_dir;
 }

}</pre>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/snowjunkiedev.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/snowjunkiedev.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/snowjunkiedev.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/snowjunkiedev.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/snowjunkiedev.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/snowjunkiedev.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/snowjunkiedev.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/snowjunkiedev.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/snowjunkiedev.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/snowjunkiedev.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/snowjunkiedev.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/snowjunkiedev.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/snowjunkiedev.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/snowjunkiedev.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=77&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-6-the-result-map-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/73c777bc3210189841f449968029a483?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">snowjunkie</media:title>
		</media:content>
	</item>
		<item>
		<title>Spring + iBatis // Part 5 // The DAO</title>
		<link>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-5-the-dao/</link>
		<comments>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-5-the-dao/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 19:44:12 +0000</pubDate>
		<dc:creator>Alastair Vance</dc:creator>
				<category><![CDATA[iBATIS]]></category>
		<category><![CDATA[Java Language]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[dao]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://snowjunkiedev.wordpress.com/?p=71</guid>
		<description><![CDATA[We declared a DAO in our applicationContext.xml file.  It&#8217;s time to create that DAO now by starting with an interface declaration.  I called this interface MyDAO.java. package com.example; import java.util.List; public interface MyDAO { FilePickup selectFilepickupInstruction(long id); List&#60;FilePickup&#62; selectFilepickupInstructions(); } Then we need to create the class that will implement this interface.  The name of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=71&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We declared a DAO in our <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-3-applicationcontext/" target="_self">applicationContext.xml</a> file.  It&#8217;s time to create that DAO now by starting with an interface declaration.  I called this interface <strong><span style="color:#333399;">MyDAO.java</span></strong>.</p>
<pre>package com.example;

import java.util.List;

public interface MyDAO {

 FilePickup selectFilepickupInstruction(long id);
 List&lt;FilePickup&gt; selectFilepickupInstructions();

}</pre>
<p>Then we need to create the class that will implement this interface.  The name of this class should match that specified in the <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-3-applicationcontext/" target="_self">applicationContext.xml</a>.  In this example it&#8217;s <strong><span style="color:#333399;">MyDAOImpl</span><span style="color:#333399;">.java</span></strong>.</p>
<pre>package com.example;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class <strong><span style="color:#333399;">MyDAOImpl </span></strong>extends SqlMapClientDaoSupport implements <span style="color:#333399;"><strong>MyDAO </strong></span>{
  public MyDAOImpl() {
  }

  public FilePickup selectFilepickupInstruction(long id) {
    return  
      (FilePickup)getSqlMapClientTemplate().queryForObject(
          "<span style="color:#333399;">selectFilepickupInstruction</span>",id);
  }
  public List&lt;FilePickup&gt; selectFilepickupInstructions() {   
      return     
        getSqlMapClientTemplate().queryForList(
            "<span style="color:#333399;">selectFilepickupInstructions</span>",null);

  }

 }
</pre>
<p>Note that a java.util.list is used to handle results from a sql statement that returns multiple rows.  The strings used in the queryForList() and queryForObject() methods are those names declared in the <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-4-sqlmap-config/" target="_self">mapping stage</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/snowjunkiedev.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/snowjunkiedev.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/snowjunkiedev.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/snowjunkiedev.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/snowjunkiedev.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/snowjunkiedev.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/snowjunkiedev.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/snowjunkiedev.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/snowjunkiedev.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/snowjunkiedev.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/snowjunkiedev.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/snowjunkiedev.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/snowjunkiedev.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/snowjunkiedev.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=71&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-5-the-dao/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/73c777bc3210189841f449968029a483?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">snowjunkie</media:title>
		</media:content>
	</item>
		<item>
		<title>Spring + iBatis // Part 4 // sqlmap-config</title>
		<link>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-4-sqlmap-config/</link>
		<comments>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-4-sqlmap-config/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 19:19:40 +0000</pubDate>
		<dc:creator>Alastair Vance</dc:creator>
				<category><![CDATA[iBATIS]]></category>
		<category><![CDATA[Java Language]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[resultMap]]></category>
		<category><![CDATA[sqlMap]]></category>
		<category><![CDATA[sqlmap-config]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://snowjunkiedev.wordpress.com/?p=66</guid>
		<description><![CDATA[The next file to create is &#8220;sqlmap-config.xml&#8221; that we declared in the applicationContext.xml file.  Create the file in the same location as before, and paste in the following XML. &#60;?xml version="1.0" encoding="UTF-8" ?&#62; &#60;!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-config-2.dtd"&#62; &#60;sqlMapConfig&#62; &#60;sqlMap resource="mySqlMap.xml"/&#62; &#60;/sqlMapConfig&#62; We could include all the mapping detail in this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=66&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The next file to create is &#8220;<strong><span style="color:#333399;">sqlmap-config.xml</span></strong>&#8221; that we declared in the <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-3-applicationcontext/" target="_self">applicationContext.xml</a> file.  Create the file in the same location as <a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-2-database-properties/" target="_self">before</a>, and paste in the following XML.</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;!DOCTYPE sqlMapConfig
 PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
 "http://ibatis.apache.org/dtd/sql-map-config-2.dtd"&gt;
&lt;sqlMapConfig&gt;
 &lt;sqlMap resource="<strong><span style="color:#333399;">mySqlMap.xml</span></strong>"/&gt;
&lt;/sqlMapConfig&gt;</pre>
<p>We could include all the mapping detail in this file, but instead we choose to link out to it should we need to extend this in future.</p>
<p>Create another file, again in the same location, called &#8220;<strong><span style="color:#333399;">mySqlMap.xml</span></strong>&#8220;.  This will contain your actual sql along with any parameter and resultset mappings.</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;!DOCTYPE sqlMap
 PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
 "http://ibatis.apache.org/dtd/sql-map-2.dtd"&gt;
&lt;sqlMap namespace="MySqlMap"&gt;

 &lt;!-- map for result set based on table --&gt;
 &lt;resultMap id="<strong><span style="color:#333399;">result</span></strong>" class="<strong><span style="color:#333399;">com.example.FilePickup</span></strong>"&gt;
 &lt;result property="id" column="ID"/&gt;
 &lt;result property="root_dir" column="ROOT_DIR"/&gt;
 &lt;result property="include_subdirs" column="INCLUDE_SUBDIRS"/&gt;
 &lt;result property="target_dir" column="TARGET_DIR"/&gt;
 &lt;result property="file_filter_list" column="FILE_FILTER_LIST"/&gt;
 &lt;result property="prefix_text" column="PREFIX_TEXT"/&gt;
 &lt;result property="postfix_text" column="POSTFIX_TEXT"/&gt;
 &lt;result property="new_ext" column="NEW_EXT"/&gt;
 &lt;result property="keep_unique" column="KEEP_UNIQUE"/&gt;
 &lt;result property="del_source" column="DEL_SOURCE"/&gt;
 &lt;result property="audit_db_properties_file" column="AUDIT_DB_PROPERTIES_FILE"/&gt;
 &lt;/resultMap&gt;

 &lt;!-- sql for retrieving from table based on one parameter --&gt;
 &lt;select id="<strong><span style="color:#333399;">selectFilepickupInstruction</span></strong>" resultMap="<span style="color:#333399;"><strong>result</strong></span>"&gt;
 SELECT
 fpc.id,
 fpc.root_dir,
 fpc.include_subdirs,
 fpc.target_dir,
 fpc.file_filter_list,
 fpc.prefix_text,
 fpc.postfix_text,
 fpc.new_ext,
 fpc.keep_unique,
 fpc.del_source,
 fpc.audit_db_properties_file            
 FROM filepickup_config fpc        
 WHERE fpc.id = #value#
 &lt;/select&gt;

 &lt;!-- getting multiple values from table --&gt;
 &lt;select id="<strong><span style="color:#333399;">selectFilepickupInstructions</span></strong>" resultMap="<span style="color:#333399;"><strong>result</strong></span>"&gt;
 SELECT
 id,
 root_dir,
 include_subdirs,
 target_dir,
 file_filter_list,
 prefix_text,
 postfix_text,
 new_ext,
 keep_unique,
 del_source,
 audit_db_properties_file            
 FROM filepickup_config
 &lt;/select&gt;

&lt;/sqlMap&gt;</pre>
<p>&nbsp;</p>
<p>The file selects from a table and offers two methods &#8211; one with a parameter and one without.  We will clearly define these methods in a later step.  Note that both methods use the same result map.  The result map is linked to a java class called <strong><span style="color:#333399;">FilePickup</span></strong>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/snowjunkiedev.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/snowjunkiedev.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/snowjunkiedev.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/snowjunkiedev.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/snowjunkiedev.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/snowjunkiedev.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/snowjunkiedev.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/snowjunkiedev.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/snowjunkiedev.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/snowjunkiedev.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/snowjunkiedev.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/snowjunkiedev.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/snowjunkiedev.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/snowjunkiedev.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=66&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-4-sqlmap-config/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/73c777bc3210189841f449968029a483?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">snowjunkie</media:title>
		</media:content>
	</item>
		<item>
		<title>Spring + iBatis // Part 3 // applicationContext</title>
		<link>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-3-applicationcontext/</link>
		<comments>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-3-applicationcontext/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 17:20:21 +0000</pubDate>
		<dc:creator>Alastair Vance</dc:creator>
				<category><![CDATA[iBATIS]]></category>
		<category><![CDATA[Java Language]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[applicationContext]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jDeveloper]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://snowjunkiedev.wordpress.com/?p=58</guid>
		<description><![CDATA[In the same location (as part 2), create another file called &#8220;applicationContext.xml&#8221;.  Paste in the following content.  Some explanation will follow below. &#60;?xml version="1.0" encoding="UTF-8"?&#62; &#60;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"&#62; &#60;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&#62; &#60;property name="location" value="classpath:database.properties"/&#62; &#60;/bean&#62; &#60;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&#62; &#60;property name="driverClassName" value="${database.class}"/&#62; &#60;property name="url" value="${database.url}"/&#62; &#60;property name="username" value="${database.username}"/&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=58&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In the same location (<a href="http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-2-database-properties/" target="_self">as part 2</a>), create another file called &#8220;applicationContext.xml&#8221;.  Paste in the following content.  Some explanation will follow below.</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

http://www.springframework.org/schema/tx

http://www.springframework.org/schema/tx/spring-tx-2.5.xsd

http://www.springframework.org/schema/aop

http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"&gt;

&lt;bean
 class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
  &lt;property name="location" value="<span style="color:#333399;"><strong>classpath:database.properties</strong></span>"/&gt;
&lt;/bean&gt;

&lt;bean
 id="dataSource"
 class="org.apache.commons.dbcp.BasicDataSource"
 destroy-method="close"&gt;
  &lt;property name="driverClassName" value="${database.class}"/&gt;
  &lt;property name="url" value="${database.url}"/&gt;
  &lt;property name="username" value="${database.username}"/&gt;
  &lt;property name="password" value="${database.password}"/&gt;
&lt;/bean&gt;

&lt;bean
 id="transactionManager"
 class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;
  &lt;property name="dataSource" ref="dataSource"/&gt;
&lt;/bean&gt;

&lt;tx:annotation-driven/&gt;

&lt;bean
 id="sqlMapClient"
 class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"&gt;
  &lt;property name="configLocation" value="<span style="color:#333399;"><strong>sqlmap-config.xml</strong></span>"/&gt;
  &lt;property name="dataSource" ref="dataSource"/&gt;
  &lt;property name="useTransactionAwareDataSource" value="true"/&gt;
&lt;/bean&gt;

&lt;bean id="<span style="color:#333399;"><strong>myDAO</strong></span>" class="<span style="color:#333399;"><strong>com.example.dao.MyDAOImpl</strong></span>"&gt;
 &lt;property name="sqlMapClient" ref="sqlMapClient"/&gt;
&lt;/bean&gt;

&lt;/beans&gt;</pre>
<p><strong>Notes:</strong></p>
<ul>
<li><span style="color:#333399;"><strong>classpath:database.properties</strong></span> points to the database.properties files we created earlier.  If you used a different location, you may need to update this value.</li>
<li><span style="color:#333399;"><strong>sqlmap-config.xml</strong></span> is a file we will create later.  It will hold our sql and mapping information.</li>
<li><strong><span style="color:#333399;">myDAO</span></strong> is our data access interface.  This will be created later also.  You may need to change the name of this, and it&#8217;s class reference.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/snowjunkiedev.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/snowjunkiedev.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/snowjunkiedev.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/snowjunkiedev.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/snowjunkiedev.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/snowjunkiedev.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/snowjunkiedev.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/snowjunkiedev.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/snowjunkiedev.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/snowjunkiedev.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/snowjunkiedev.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/snowjunkiedev.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/snowjunkiedev.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/snowjunkiedev.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=58&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-3-applicationcontext/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/73c777bc3210189841f449968029a483?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">snowjunkie</media:title>
		</media:content>
	</item>
		<item>
		<title>Spring + iBatis // Part 2 // Database Properties</title>
		<link>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-2-database-properties/</link>
		<comments>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-2-database-properties/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 16:54:57 +0000</pubDate>
		<dc:creator>Alastair Vance</dc:creator>
				<category><![CDATA[iBATIS]]></category>
		<category><![CDATA[Java Language]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[properties]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://snowjunkiedev.wordpress.com/?p=54</guid>
		<description><![CDATA[In the JDeveloper IDE, right click on the resources folder in your project structure (applications navigator window).  Select &#8220;New&#8230;&#8221; from the window and &#8220;File&#8221; from the general category.  Name the new file &#8220;database.properties&#8221;. database.username=username database.password=password database.class=oracle.jdbc.OracleDriver database.url=jdbc:oracle:thin:@host:port:sid Place the above in the file (substitute values in italics) and save your project.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=54&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In the JDeveloper IDE, right click on the resources folder in your project structure (applications navigator window).  Select &#8220;New&#8230;&#8221; from the window and &#8220;File&#8221; from the general category.  Name the new file &#8220;database.properties&#8221;.</p>
<pre>database.username=<span style="color:#333399;"><em>username</em></span>
database.password=<span style="color:#333399;"><em>password</em></span>
database.class=oracle.jdbc.OracleDriver
database.url=jdbc:oracle:thin:@<span style="color:#333399;"><em>host</em></span>:<span style="color:#333399;"><em>port</em></span>:<span style="color:#333399;"><em>sid</em></span></pre>
<p>Place the above in the file (substitute values in italics) and save your project.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/snowjunkiedev.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/snowjunkiedev.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/snowjunkiedev.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/snowjunkiedev.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/snowjunkiedev.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/snowjunkiedev.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/snowjunkiedev.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/snowjunkiedev.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/snowjunkiedev.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/snowjunkiedev.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/snowjunkiedev.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/snowjunkiedev.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/snowjunkiedev.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/snowjunkiedev.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=54&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-2-database-properties/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/73c777bc3210189841f449968029a483?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">snowjunkie</media:title>
		</media:content>
	</item>
		<item>
		<title>Spring + iBatis // Part 1 // Libraries</title>
		<link>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-1-libraries/</link>
		<comments>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-1-libraries/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 16:12:22 +0000</pubDate>
		<dc:creator>Alastair Vance</dc:creator>
				<category><![CDATA[iBATIS]]></category>
		<category><![CDATA[Java Language]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jDeveloper]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://snowjunkiedev.wordpress.com/?p=51</guid>
		<description><![CDATA[I&#8217;ve just discovered the greatness of Spring and iBatis.  This will be the first in a series of posts that will help you configure the environment in JDeveloper 10.1.3.3.  First of all, here are the libraries you need to include in your project. Spring 2.5 Commons Logging 1.0.3 Commons Collections 2.1 Oracle JDBC Commons-dbcp-1.2.2.jar Commons-pool-1.5.4.jar [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=51&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just discovered the greatness of <a href="http://www.springsource.org/" target="_blank">Spring</a> and <a href="http://ibatis.apache.org/" target="_blank">iBatis</a>.  This will be the first in a series of posts that will help you configure the environment in <a href="http://www.oracle.com/tools/jdev_home.html" target="_blank">JDeveloper 10.1.3.3</a>.  First of all, here are the libraries you need to include in your project.</p>
<ul>
<li>Spring 2.5</li>
<li>Commons Logging 1.0.3</li>
<li>Commons Collections 2.1</li>
<li>Oracle JDBC</li>
<li><a href="http://commons.apache.org/dbcp/downloads.html" target="_blank">Commons-dbcp-1.2.2.jar</a></li>
<li><a href="http://commons.apache.org/pool/downloads.html" target="_blank">Commons-pool-1.5.4.jar</a></li>
<li><a href="http://ibatis.apache.org/java.cgi" target="_blank">iBatis.2.3.4.726.jar</a></li>
<li>Commons Beanutils 1.6.1</li>
<li>Commons Digester 1.5</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/snowjunkiedev.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/snowjunkiedev.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/snowjunkiedev.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/snowjunkiedev.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/snowjunkiedev.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/snowjunkiedev.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/snowjunkiedev.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/snowjunkiedev.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/snowjunkiedev.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/snowjunkiedev.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/snowjunkiedev.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/snowjunkiedev.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/snowjunkiedev.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/snowjunkiedev.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=51&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://snowjunkiedev.wordpress.com/2009/11/25/spring-ibatis-part-1-libraries/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/73c777bc3210189841f449968029a483?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">snowjunkie</media:title>
		</media:content>
	</item>
		<item>
		<title>BPEL // ORABPEL-11814 Invalid ISO8601 datetime specification</title>
		<link>http://snowjunkiedev.wordpress.com/2009/11/05/bpel-orabpel-11814-invalid-iso8601-datetime-specification/</link>
		<comments>http://snowjunkiedev.wordpress.com/2009/11/05/bpel-orabpel-11814-invalid-iso8601-datetime-specification/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 17:50:41 +0000</pubDate>
		<dc:creator>Alastair Vance</dc:creator>
				<category><![CDATA[BPEL]]></category>
		<category><![CDATA[bindingFault]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[ISO8601]]></category>
		<category><![CDATA[ORABPEL-11814]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[procedure]]></category>
		<category><![CDATA[time zone]]></category>

		<guid isPermaLink="false">http://snowjunkiedev.wordpress.com/?p=47</guid>
		<description><![CDATA[I&#8217;m using BPEL to call out to a stored procedure in Oracle.  Some of the procedure parameters are of type DATE.  I was using the following date format for sending through to the procedure. 2009-07-02 12:18:02 PM This returned the following bindingFault in the BPEL console: The date or timestamp specification 2009-07-02 12:18:02 PM is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=47&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using BPEL to call out to a stored procedure in Oracle.  Some of the procedure parameters are of type DATE.  I was using the following date format for sending through to the procedure.</p>
<pre>2009-07-02 12:18:02 PM</pre>
<p>This returned the following <strong>bindingFault</strong> in the BPEL console:</p>
<pre>The date or timestamp specification
2009-07-02 12:18:02 PM
is not ISO8601 compliant.
; nested exception is: ORABPEL-11814
Invalid ISO8601 datetime specification.</pre>
<p>I searched for <strong>ISO8601</strong> details and <a href="http://forums.oracle.com/forums/thread.jspa?threadID=829115" target="_blank">found a post</a> that explained that the date should be in the following format:</p>
<pre>YYYY-MM-DDTHH:mm:ss.SSS</pre>
<p>The <em>.SSS</em> is milliseconds and is optional.  It is also possible to append the timezone from which the time belongs to using the format <em>-HH:mm</em> or <em>+HH:mm</em>.</p>
<p>Upon updating my code, BPEL was able to pass the date values through to the procedures without any issues.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/snowjunkiedev.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/snowjunkiedev.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/snowjunkiedev.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/snowjunkiedev.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/snowjunkiedev.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/snowjunkiedev.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/snowjunkiedev.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/snowjunkiedev.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/snowjunkiedev.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/snowjunkiedev.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/snowjunkiedev.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/snowjunkiedev.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/snowjunkiedev.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/snowjunkiedev.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=47&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://snowjunkiedev.wordpress.com/2009/11/05/bpel-orabpel-11814-invalid-iso8601-datetime-specification/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/73c777bc3210189841f449968029a483?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">snowjunkie</media:title>
		</media:content>
	</item>
		<item>
		<title>BPEL // The result is empty for the XPath expression</title>
		<link>http://snowjunkiedev.wordpress.com/2009/10/22/bpel-the-result-is-empty-for-the-xpath-expression/</link>
		<comments>http://snowjunkiedev.wordpress.com/2009/10/22/bpel-the-result-is-empty-for-the-xpath-expression/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 19:18:54 +0000</pubDate>
		<dc:creator>Alastair Vance</dc:creator>
				<category><![CDATA[BPEL]]></category>
		<category><![CDATA[check if null]]></category>
		<category><![CDATA[empty element]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[selectionFailure]]></category>
		<category><![CDATA[workaround]]></category>
		<category><![CDATA[XPATH]]></category>

		<guid isPermaLink="false">http://snowjunkiedev.wordpress.com/?p=45</guid>
		<description><![CDATA[Some of my xml elements are optional.  The customer need not populate them or even include them in the file.  BPEL does not like when I try to retrieve the value like this: bpws:getVariableData(&#8216;var_IncomingFile&#8217;,'ORDERS&#8217;,'/ns2:ORDERS/ns2:ORDER[bpws:getVariableData("var_LoopIterator")]/ns2:OPTIONAL_FIELD/text()&#8217;) It spits out this error and throws a selectionFailure: Error in evaluate &#60;from&#62; expression at line &#8220;347&#8243;. The result is empty [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=45&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some of my xml elements are optional.  The customer need not populate them or even include them in the file.  BPEL does not like when I try to retrieve the value like this:</p>
<p><span style="color:#808080;">bpws:getVariableData(&#8216;var_IncomingFile&#8217;,'ORDERS&#8217;,'/ns2:ORDERS/ns2:ORDER[bpws:getVariableData("var_LoopIterator")]/ns2:OPTIONAL_FIELD/text()&#8217;)</span></p>
<p>It spits out this error and throws a selectionFailure:</p>
<p><span style="color:#808080;">Error in evaluate &lt;from&gt; expression at line &#8220;347&#8243;. The result is empty for the XPath expression : &#8220;bpws:getVariableData(&#8216;var_IncomingFile&#8217;,'ORDERS&#8217;,'/ns2:ORDERS/ns2:ORDER[bpws:getVariableData("var_LoopIterator")]/ns2:OPTIONAL_FIELD/text()&#8217;)&#8221;.</span></p>
<p>To get it to work I had to do this:</p>
<p><span style="color:#808080;">concat(bpws:getVariableData(&#8216;var_IncomingFile&#8217;,'ORDERS&#8217;,'/ns2:ORDERS/ns2:ORDER[bpws:getVariableData("var_LoopIterator")]/ns2:OPTIONAL_FIELD/text()&#8217;),&#8221;)</span></p>
<p>Is there a more elegant way?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/snowjunkiedev.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/snowjunkiedev.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/snowjunkiedev.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/snowjunkiedev.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/snowjunkiedev.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/snowjunkiedev.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/snowjunkiedev.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/snowjunkiedev.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/snowjunkiedev.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/snowjunkiedev.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/snowjunkiedev.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/snowjunkiedev.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/snowjunkiedev.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/snowjunkiedev.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=snowjunkiedev.wordpress.com&amp;blog=8368871&amp;post=45&amp;subd=snowjunkiedev&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://snowjunkiedev.wordpress.com/2009/10/22/bpel-the-result-is-empty-for-the-xpath-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/73c777bc3210189841f449968029a483?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">snowjunkie</media:title>
		</media:content>
	</item>
	</channel>
</rss>
