ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: How to setup JNDI connection in ibatis
Date Thu, 27 Sep 2007 14:49:54 GMT
On a side note: ensure that 'select * from PODATA' doesn't return a huge
resultset, preferably just one row, one column.

 

________________________________

From: Ashish Kulkarni [mailto:ashish.kulkarni13@gmail.com] 
Sent: donderdag 27 september 2007 15:59
To: user-java@ibatis.apache.org
Subject: Re: How to setup JNDI connection in ibatis

 

Hi
I am using tomcat application server, and using the Administator
application i added JNDI for my database, i found that it had added
following entry in server.xml file

<Resource
name="AS400B" 
type="javax.sql.DataSource"
password="password"
driverClassName="com.ibm.as400.access.AS400JDBCDriver"
maxIdle="2"
maxWait="5000" 
validationQuery="select * from PODATA"
username="userid"
url="jdbc:as400:AS400B/RPTSTEXTDB;naming=system;date format=iso;time
format=hms;prompt=false"
maxActive="4"/> 



On 9/26/07, Richard Yee <ryee@cruzio.com> wrote:

You need to set up the connection pool in your application server
configuration. What AppServer are you using?

-Richard

Ashish Kulkarni wrote:
> Hi
> I did modify this to look like below
> <transactionManager type="JDBC"> 
>     <dataSource type="JNDI">
>           <property name="DataSource" value="AS400B"/>
>     </dataSource>
> </transactionManager>
>
> But i get following error in tomcat, I have created a data sourse
> AS400B in tomcat
>
> Caused by: javax.naming.NameNotFoundException: Name AS400B is not
> bound in this Context
> at
>
com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConf
igParser.java:81)
> at
>
com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapCli
entBuilder.java:62)
> at com.pfizer.maps.data.GetSQLConfigForWeb.getSqlMapInstance 
> (GetSQLConfigForWeb.java:49)
> at
>
com.pfizer.maps.servlet.Log4JInitServlet.init(Log4JInitServlet.java:104)
> at
>
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
a :1105)
>
>
>
>
>
> On 9/26/07, *Ashish Kulkarni* <ashish.kulkarni13@gmail.com
> <mailto: ashish.kulkarni13@gmail.com
<mailto:ashish.kulkarni13@gmail.com> >> wrote:
>
>     Hi
>     Is there any example of setting up ibatis to use JNDI as data
source,
>     I have the following, how do i change it to use JNDI
> 
>     <properties resource="SqlMapConfigAS400.properties" />
>     <transactionManager type="JDBC">
>     <dataSource type="SIMPLE">
>     <property name=" JDBC.Driver" value="${driver}" />
>
>     <property name="JDBC.ConnectionURL" value="${url}" />
>
>     <property name="JDBC.Username" value="${username}" /> 
>
>     <property name="JDBC.Password" value="${password}" />
>     </dataSource>
>     </transactionManager>
>
>     And i have SqlMapConfigAS400.properties where i have
>     driver=com.ibm.as400.access.AS400JDBCDriver
>
>     url=jdbc:as400:AS400B/RPTSTEXTDB;naming=system;date
>     format=iso;time format=hms;prompt=false
>
>     username=user 
>
>     password=password
>
>
>
>
>
>

 


Mime
View raw message