ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brice Ruth <bdr...@gmail.com>
Subject Re: is it possible to query views with ibatis ?
Date Thu, 24 Mar 2005 14:12:52 GMT
The '$' is a special character in iBATIS, used for parameter maps.Try '$$'


On Thu, 24 Mar 2005 13:00:39 +0100, zouaoui anis <anis.zouaoui@gmail.com> wrote:
> Hi all,
> I want to query V$views in oracle db, I used this sqlMap
> 
> <select  id="kpis_values"       parameterClass="java.lang.String" resultClass="MyKpi">
>                  SELECT
>                          NAME  as name,
>                          VALUE as value
>                  FROM V$SYSSTAT
> </select>
> 
> But I got the following Exception, I tried to querry a table named
> COPIE a copie of  V$SYSSTAT's data (instead of V$SYSSTAT) (create
> COPIE as (SELECT  NAME  as name, VALUE as value FROM V$SYSSTAT) and it
> works.
> 
> My question is: how can I querry v$ views (or other views) using ibatis ?
> 
> Thank in advance for your help.
> Kindest regards
> Anis
> 
> 2005-03-24 12:50:52,062 [DEBUG]
> com.ibatis.common.jdbc.SimpleDataSource - Created connection 6182315.
> 2005-03-24 12:50:52,062 [DEBUG] java.sql.Connection - {conn-100000} Connection
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in dao-config/kpiMap.xml.
> --- The error occurred while preparing the mapped statement for execution.
> --- Check the anis.
> --- Check the SQL statement.
> --- Cause: java.util.NoSuchElementException
> Caused by: java.util.NoSuchElementException
>         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:184)
>         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:119)
>         at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
>         at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
>         at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:105)
>         at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:77)
>         at ..dao.ibatis.sqlmap.SqlMapKpiDao.getKpis(SqlMapKpiDao.java:60)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:64)
>         at $Proxy0.getKpis(Unknown Source)
>         at MyAppSqlConfig.<clinit>(MyAppSqlConfig.java:56)
> Caused by: java.util.NoSuchElementException
>         at java.util.StringTokenizer.nextToken(StringTokenizer.java:259)
>         at com.ibatis.sqlmap.engine.mapping.sql.simple.SimpleDynamicSql.processDynamicElements(SimpleDynamicSql.java:90)
>         at com.ibatis.sqlmap.engine.mapping.sql.simple.SimpleDynamicSql.getSql(SimpleDynamicSql.java:45)
>         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:164)
>         ... 13 more
> 
> Caused by:
> java.util.NoSuchElementException
>         at java.util.StringTokenizer.nextToken(StringTokenizer.java:259)
>         at com.ibatis.sqlmap.engine.mapping.sql.simple.SimpleDynamicSql.processDynamicElements(SimpleDynamicSql.java:90)
>         at com.ibatis.sqlmap.engine.mapping.sql.simple.SimpleDynamicSql.getSql(SimpleDynamicSql.java:45)
>         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:164)
>         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:119)
>         at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
>         at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
>         at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:105)
>         at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:77)
>         at ..dao.ibatis.sqlmap.SqlMapKpiDao.getKpis(SqlMapKpiDao.java:60)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:64)
>         at $Proxy0.getKpis(Unknown Source)
>         at MyAppSqlConfig.<clinit>(MyAppSqlConfig.java:56)
> 
> Caused by:
> java.util.NoSuchElementException
>         at java.util.StringTokenizer.nextToken(StringTokenizer.java:259)
>         at com.ibatis.sqlmap.engine.mapping.sql.simple.SimpleDynamicSql.processDynamicElements(SimpleDynamicSql.java:90)
>         at com.ibatis.sqlmap.engine.mapping.sql.simple.SimpleDynamicSql.getSql(SimpleDynamicSql.java:45)
>         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:164)
>         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:119)
>         at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
>         at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
>         at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:105)
>         at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:77)
>         at ..dao.ibatis.sqlmap.SqlMapKpiDao.getKpis(SqlMapKpiDao.java:60)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:64)
>         at $Proxy0.getKpis(Unknown Source)
>         at MyAppSqlConfig.<clinit>(MyAppSqlConfig.java:56)
> 2005-03-24 12:50:52,093 [DEBUG]
> com.ibatis.common.jdbc.SimpleDataSource - Returned connection 6182315
> to pool.
> java.lang.NullPointerException
>         at MyAppSqlConfig.<clinit>(MyAppSqlConfig.java:57)
> java.lang.ExceptionInInitializerError
> Caused by: java.lang.RuntimeException: Error initializing
> MyAppSqlConfig class. Cause: java.lang.NullPointerException
>         at MyAppSqlConfig.<clinit>(MyAppSqlConfig.java:75)
> Exception in thread "main"
>

Mime
View raw message