Home > Java > How to run iBatis using Namespace

How to run iBatis using Namespace

Have you ever run the query i the iBatis Sqlmap and got the erroneous lines of code when you use the namespace into it?

com.ibatis.sqlmap.client.SqlMapException: There is no statement named Salesman.insert  in this SqlMap.

It easy enough to solve the problem, just add the line below in your iBatis Configuration and make sure you now use the namespace when calling it.


<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE sqlMapConfigPUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN""http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>

<settings useStatementNamespaces="true" /> <!-- add this line -->

<sqlMap resource="ibatis/Web-Registration-Report.xml" />

</sqlMapConfig>

Be aware. Since now, your code will produce error if you not using the namespace. So it will be wiser to make a final decision whether to use the namespace or not.

Advertisements
Categories: Java Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: