ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Merritt, Norris" <norris.merr...@hp.com>
Subject RE: "There is no statement named getFoo in this sqlMap" error when there IS a statement with that exact id...
Date Fri, 07 Jul 2006 21:33:30 GMT
I don't think I have namespaces enabled in sqlmapconfig, unless it is
some sort of default. Here is my sql-map-config.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig SYSTEM "sql-map-config-2.dtd" >
<sqlMapConfig>
  <transactionManager type="JDBC" >
    <dataSource type="SIMPLE">
      <property name="JDBC.Driver"
value="com.inet.tds.TdsDriver"/>
      <property name="JDBC.ConnectionURL"
value="jdbc:inetdae7:NMERRITT"/>
      <property name="JDBC.Username"       value="xxxxx"/>
      <property name="JDBC.Password"       value="yyyyy"/>
      <property name="JDBC.DefaultAutoCommit" value="true" />
      <property name="Pool.MaximumActiveConnections" value="10"/>
      <property name="Pool.MaximumIdleConnections" value="5"/>
      <property name="Pool.MaximumCheckoutTime" value="120000"/>
      <property name="Pool.TimeToWait" value="500"/>
    </dataSource>
  </transactionManager>
</sqlMapConfig>

-----Original Message-----
From: larry.meadors@gmail.com [mailto:larry.meadors@gmail.com] On Behalf
Of Larry Meadors
Sent: Friday, July 07, 2006 2:23 PM
To: user-java@ibatis.apache.org
Subject: Re: "There is no statement named getFoo in this sqlMap" error
when there IS a statement with that exact id...

Do you have namespaces enabled in sqlmapconfig?

I bet lunch that you do. :-)

Larry


On 7/7/06, Merritt, Norris <norris.merritt@hp.com> wrote:
>
>
>
>
> Obviously there is something wrong with the trivially simple sqlMap
file
> shown below, but being so new to iBatis I can't figure out what it is.
>
> If someone would kindly point it out I would appreciate it. Other
folks
> having this symptom were doing things with Abator and namespaces,
which I am
> not.
>
>
>
> The error occurs when I execute the line of code
>
>
>
>      sqlMap.queryForObject("getFoo", paramMap, resultMap );
>
>
>
> I expected to get a hashmap in resultMap consisting of name/value
pairs for
> all columns of the single row of footable that would be returned by my
> select statement if it were executed, but instead I get:
>
>
>
> com.ibatis.sqlmap.client.SqlMapException: There is no
> statement named getFoo in this SqlMap.
>
>       at
>
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(
SqlMapExecutorDelegate.java:288)
>
>       at
>
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlM
apExecutorDelegate.java:552)
>
>       at
>
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSes
sionImpl.java:97)
>
>       at
>
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClie
ntImpl.java:74)
>
>       at FooTest.main(FooTest.java:26)
>
>
>
>
>
> I know that my sqlMap xml file is being loaded and parsed because if I
> introduce errors into it, the parser throws appropriate exceptions.
>
> As given below, the parser accepts the sqlMap file but I get the above
> exception trying to do the query shown above.
>
>
>
> <sqlMap>
>
>
>
>   <statement id="getFoo" parameterMap="getFooMap"
> parameterClass="java.util.Map" resultClass="java.util.HashMap">
>
>
>
>       select * from dbo.footable as foo where foo.id = '#id#'
>
>
>
>   </statement>
>
>
>
>   <parameterMap id="getFooMap" class="java.util.HashMap">
>
>     <parameter property ="id" jdbcType="VARCHAR" javaType="string" />
>
>   </parameterMap>
>
>
>
> </sqlMap>

Mime
View raw message