ibatis 3 and calling stored procedure

2010-06-28 Thread Ashish Kulkarni
Hi
Is there any place where it has updated information about calling stored
procedure from ibatis 3.0, i checked google and could not find any,
I was reading user guide and it says parameterMap is not used,

I tried the code below and seems it is working, but i would like to do this
using some methods from ibatis 3.0




 


call SCHEMA.PROCEDURE (?,?)


-- 
Ashish
www.ayurwellness.com
www.mysoftwareneeds.com


Re: Inserting Japanese characters in database using ibatis

2009-07-25 Thread Ashish Kulkarni
HiThe issue is resolved, database had correct characters, web application
displaying data was not displaying them properly


On Fri, Jul 24, 2009 at 9:04 PM, Stephen Boyd  wrote:

> Ibatis is most likely not the problem.  The database needs to be configured
> to accept unicode characters.  What database are you using?
>
>
> On Fri, Jul 24, 2009 at 12:22 PM, Ashish Kulkarni <
> ashish.kulkarn...@gmail.com> wrote:
>
>> HiHas anyone noticed issue with inserting japanese characters in database
>> using ibatis, i am having some issues here, i have debugged my program and
>> found that the class which is passed to ibatis as input parameter has
>> correct japanese characters, but in database they are not,
>> Is there any special setup for inserting non english characters in ibatis?
>>
>> Ash
>>
>
>


Inserting Japanese characters in database using ibatis

2009-07-24 Thread Ashish Kulkarni
HiHas anyone noticed issue with inserting japanese characters in database
using ibatis, i am having some issues here, i have debugged my program and
found that the class which is passed to ibatis as input parameter has
correct japanese characters, but in database they are not,
Is there any special setup for inserting non english characters in ibatis?

Ash


Question about Dynamic and iterator

2009-06-22 Thread Ashish Kulkarni
HiI have to write a query like below

Select col1, col2 from table1 where col3='ABC' or col3='XYZ'

so i wrote a query like below, will this work, *what do i have  to specify
for property, *i have specified it as list, will this work, any suggestions



SELECT col1, col2 FROM table1


col3=*#list[]#*




or should i change it to







SELECT col1, col2 FROM table1


col3=*#id[]#*





Re: How to test Pool.PingQuery with Simple Datasource

2009-05-06 Thread Ashish Kulkarni
Hi Any ideas on this mail, how to test if Pool.PingQuery is working as
expected

On Mon, May 4, 2009 at 10:03 AM, Ashish Kulkarni <
ashish.kulkarn...@gmail.com> wrote:

> HiI have configured my data Source as below
> 
> 
>   />
>  value="jdbc:as400:MYAS400/MYDB;naming=system;date format=iso;time
> format=hms;prompt=false" />
>  
> 
>   value="Select TYPE FROM APP_TYPE" />
>  
> 
>  
> 
> 
>
> In my Log4j.xml i have following lines to debug all queries, but i do not
> see any PingQuery log in my log files, what am i missing, what is the way to
> make sure that Pool.PingQuery is working as expected, i am going to
> change Pool.PingConnectionsOlderThan to 180 and
> Pool.PingConnectionsNotUsedFor to 180 so to use PingQuery if the
> connection is older then 30 minutes.
>
>  
> 
> 
> 
> 
> 
>


How to test Pool.PingQuery with Simple Datasource

2009-05-04 Thread Ashish Kulkarni
HiI have configured my data Source as below













In my Log4j.xml i have following lines to debug all queries, but i do not
see any PingQuery log in my log files, what am i missing, what is the way to
make sure that Pool.PingQuery is working as expected, i am going to
change Pool.PingConnectionsOlderThan to 180 and
Pool.PingConnectionsNotUsedFor to 180 so to use PingQuery if the
connection is older then 30 minutes.

 







Re: connection link failure issue

2009-04-27 Thread Ashish Kulkarni
HiSo if i add the following to the SimpleDataSource properties will it work,
will Ping Connections older then 30 minutes,  or connections not used for 30
minutes and then recreate them if required or have issue?








On Mon, Apr 27, 2009 at 3:43 PM, Chris O'Connell <
oconn...@gorillachicago.com> wrote:

> Configuring your 'ping' query will be specific to whatever database
> connection pool you are using.  See if there is some documentation you can
> find for your pool.  In general, what this will do is just have the pool
> execute some very simple query at some configurable time.  This shouldn't
> execute every time a user needs a connection from the pool.  Instead, this
> should execute every 15 minutes or 30 minutes (or whatever).  Basically, you
> are executing these queries every so often so that the systems around you
> are reminded that these connections are active and shouldn't be closed.
>
>
> On Mon, Apr 27, 2009 at 2:39 PM, Ashish Kulkarni <
> ashish.kulkarn...@gmail.com> wrote:
>
>> HiHow does the performance get affected if i add a ping query, or what is
>> the best way to do it
>>
>> On Fri, Apr 24, 2009 at 1:10 PM, Chema  wrote:
>>
>>> Logs show that he's using a SimpleDataSource , so I guess, the
>>> connection pool is implemented by iBatis
>>>
>>> I bet for a "firewall issue". Some is resetting the connection.
>>> (Connection reset)
>>>
>>>
>>>
>>> 2009/4/24 Chris O'Connell :
>>> > I think the issue is within the database pool you are using, with is an
>>> > entity separate from iBatis.
>>>
>>
>>
>
>
> --
> --
> Chris O'Connell
> Application Developer
> Gorilla
> 312.243.8777 x19
>
>


Re: connection link failure issue

2009-04-27 Thread Ashish Kulkarni
HiHow does the performance get affected if i add a ping query, or what is
the best way to do it

On Fri, Apr 24, 2009 at 1:10 PM, Chema  wrote:

> Logs show that he's using a SimpleDataSource , so I guess, the
> connection pool is implemented by iBatis
>
> I bet for a "firewall issue". Some is resetting the connection.
> (Connection reset)
>
>
>
> 2009/4/24 Chris O'Connell :
> > I think the issue is within the database pool you are using, with is an
> > entity separate from iBatis.
>


Re: connection link failure issue

2009-04-24 Thread Ashish Kulkarni
HiExactly, some thing which will check if the connection is alive, but how
to make ibatis do so?

On Fri, Apr 24, 2009 at 11:52 AM, Chris O'Connell <
oconn...@gorillachicago.com> wrote:

> There are certainly wiser minds here, but it sounds like the database is
> thinking that the connection has been abandoned (because it hasn't been used
> in so long) and so it kills the connection.  A new user comes along and
> grabs a connection out of the pool.  The pool doesn't know that the
> connection is dead so it passes it on to the code and you see that error.
>  At this point, the pool probably realizes that this connection is hosed, so
> it creates a new one and so the next call gets the 'good' connection and
> everything works.
> I would look and see if the pool you are using has some sort of 'ping' that
> you could configure.  It would do something like select the current system
> time or something.  This would just let the database know not to kill the
> connection in the first place.
>
> Good luck.
>
>
> On Fri, Apr 24, 2009 at 10:41 AM, Ashish Kulkarni <
> ashish.kulkarn...@gmail.com> wrote:
>
>> HiThere is no SQL error code in log file, and this is all in intranet so
>> there is no firewall in between.
>> i believe this happens for first transaction in  a day, when no one has
>> used the application for about 10 hours and starting to use it again
>>
>> On Fri, Apr 24, 2009 at 10:42 AM, Mario Ds Briggs <
>> mario.bri...@in.ibm.com> wrote:
>>
>>> What's  SQL ERROR CODE in the exception. You want to look it up the DB2
>>> on
>>> AS400 docs
>>>
>>>
>>>
>>>
>>> Ashish Kulkarni
>>> >> 3...@gmail.com>
>>> To
>>>   user-java@ibatis.apache.org
>>> 24/04/2009 19:39   cc
>>>
>>>   Subject
>>> Please respond to connection link failure issue
>>> user-j...@ibatis.
>>>apache.org
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Hi
>>> I am having some issue with connection dropping, i am using
>>> ibatis ibatis-2.3.4.726.jar and creating connection to AS400 using JDBC,
>>> but i am seeing these errors in log file, for some reason connection is
>>> getting dropped, what may be the reason, the issue is this a high
>>> availability system and we cannot let any single transaction fell because
>>> of this issue, when we try second time the transaction works, so what
>>> should i do,
>>>
>>> java.sql.SQLException: Communication link failure. (Connection reset)
>>> at com.ibm.as400.access.JDError.throwSQLException(JDError.java:528)
>>> at
>>>
>>> com.ibm.as400.access.AS400JDBCConnection.sendAndReceive(AS400JDBCConnection.java:2668)
>>> at
>>>
>>> com.ibm.as400.access.AS400JDBCConnection.sendAndReceive(AS400JDBCConnection.java:2581)
>>> at
>>>
>>> com.ibm.as400.access.JDTransactionManager.rollback(JDTransactionManager.java:440)
>>> at
>>>
>>> com.ibm.as400.access.AS400JDBCConnection.rollback(AS400JDBCConnection.java:2252)
>>> at
>>>
>>> com.ibatis.common.jdbc.SimpleDataSource.popConnection(SimpleDataSource.java:629)
>>> at
>>>
>>> com.ibatis.common.jdbc.SimpleDataSource.getConnection(SimpleDataSource.java:222)
>>> at
>>>
>>> com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48)
>>> at
>>>
>>> com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89)
>>> at
>>>
>>> com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139)
>>> at
>>>
>>> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567)
>>> at
>>>
>>> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541)
>>> at
>>>
>>> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
>>> at
>>>
>>> com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:94)
>>>
>>>
>>
>
>
> --
> --
> Chris O'Connell
> Application Developer
> Gorilla
> 312.243.8777 x19
>
>


Re: connection link failure issue

2009-04-24 Thread Ashish Kulkarni
HiThere is no SQL error code in log file, and this is all in intranet so
there is no firewall in between.
i believe this happens for first transaction in  a day, when no one has used
the application for about 10 hours and starting to use it again

On Fri, Apr 24, 2009 at 10:42 AM, Mario Ds Briggs
wrote:

> What's  SQL ERROR CODE in the exception. You want to look it up the DB2 on
> AS400 docs
>
>
>
>
>     Ashish Kulkarni
>  3...@gmail.com>   To
>   user-java@ibatis.apache.org
> 24/04/2009 19:39   cc
>
>   Subject
> Please respond to connection link failure issue
> user-j...@ibatis.
>apache.org
>
>
>
>
>
>
>
>
> Hi
> I am having some issue with connection dropping, i am using
> ibatis ibatis-2.3.4.726.jar and creating connection to AS400 using JDBC,
> but i am seeing these errors in log file, for some reason connection is
> getting dropped, what may be the reason, the issue is this a high
> availability system and we cannot let any single transaction fell because
> of this issue, when we try second time the transaction works, so what
> should i do,
>
> java.sql.SQLException: Communication link failure. (Connection reset)
> at com.ibm.as400.access.JDError.throwSQLException(JDError.java:528)
> at
>
> com.ibm.as400.access.AS400JDBCConnection.sendAndReceive(AS400JDBCConnection.java:2668)
> at
>
> com.ibm.as400.access.AS400JDBCConnection.sendAndReceive(AS400JDBCConnection.java:2581)
> at
>
> com.ibm.as400.access.JDTransactionManager.rollback(JDTransactionManager.java:440)
> at
>
> com.ibm.as400.access.AS400JDBCConnection.rollback(AS400JDBCConnection.java:2252)
> at
>
> com.ibatis.common.jdbc.SimpleDataSource.popConnection(SimpleDataSource.java:629)
> at
>
> com.ibatis.common.jdbc.SimpleDataSource.getConnection(SimpleDataSource.java:222)
> at
>
> com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48)
> at
>
> com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89)
> at
>
> com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139)
> at
>
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567)
> at
>
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541)
> at
>
> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
> at
>
> com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:94)
>
>


connection link failure issue

2009-04-24 Thread Ashish Kulkarni
HiI am having some issue with connection dropping, i am using
ibatis ibatis-2.3.4.726.jar and creating connection to AS400 using JDBC,
but i am seeing these errors in log file, for some reason connection is
getting dropped, what may be the reason, the issue is this a high
availability system and we cannot let any single transaction fell because of
this issue, when we try second time the transaction works, so what should i
do,

java.sql.SQLException: Communication link failure. (Connection reset)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:528)
at
com.ibm.as400.access.AS400JDBCConnection.sendAndReceive(AS400JDBCConnection.java:2668)
at
com.ibm.as400.access.AS400JDBCConnection.sendAndReceive(AS400JDBCConnection.java:2581)
at
com.ibm.as400.access.JDTransactionManager.rollback(JDTransactionManager.java:440)
at
com.ibm.as400.access.AS400JDBCConnection.rollback(AS400JDBCConnection.java:2252)
at
com.ibatis.common.jdbc.SimpleDataSource.popConnection(SimpleDataSource.java:629)
at
com.ibatis.common.jdbc.SimpleDataSource.getConnection(SimpleDataSource.java:222)
at
com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48)
at
com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:94)


com.ibatis.common.xml.NodeletException: Error parsing XML.Cause: java.net.ProtocolException: Server redirected too many times (20)

2009-03-30 Thread Ashish Kulkarni
HiI am having issue with ibatis, the error i am getting is

Error occurred.  Cause: com.ibatis.common.xml.NodeletException: Error
parsing XML. Cause: java.net.ProtocolException: Server redirected too many
 times (20)
java.net.ProtocolException: Server redirected too many  times (20)

How can i resolve this issue, it seems that from my server, it is not able
to reach http://ibatis.apache.org/dtd/sql-map-2.dtd to validated the XML
file.

Is there a way i can download and copy this dtd in the same folder as xml
file, so dont ahve to go to internet to validate

The current xml file is as below



http://ibatis.apache.org/dtd/sql-map-2.dtd";>






Ashish


Re: Issue with SQL query in ibatis

2009-02-20 Thread Ashish Kulkarni
Hican you please explain what do you there are no parameter markers


SELECT TYPE, AS400NAME, ENVNAME, ENVDESC, DISABLED, INIPROG,
INIPGMLIB, USERID, PASS_WRD, MAPSLOGINR FROM EnvNames WHERE TYPE =tYPE and
AS400NAME =aS400Name and ENVNAME=eNVNAME


i have TYPE=tYPE, which i expect to work as marker, the EnvNames class has
get and set method for tYPE, aS400NAME
What am i suppose to do to modify this query


On Fri, Feb 20, 2009 at 3:47 PM, Larry Meadors wrote:

> The first mapped statement doesn't appear to have any parameter
> markers in it. :-/
>
> Larry
>


Issue with SQL query in ibatis

2009-02-20 Thread Ashish Kulkarni
HiI have a query as below where resultClass is same as parameterClass, for
some reason the response i get when i run this query is parameterClass, for
example if i input as

EnvNames envNames = new EnvNames();
envNames.setTYPE("APPROVALS");
envNames.setAS400NAME("PGMAPSD1");
envNames.setENVNAME("MAPS6301S2");


SELECT TYPE, AS400NAME, ENVNAME, ENVDESC, DISABLED, INIPROG,
INIPGMLIB, USERID, PASS_WRD, MAPSLOGINR FROM EnvNames WHERE TYPE =tYPE and
AS400NAME =aS400Name and ENVNAME=eNVNAME


I get response as below, which is wrong, because i am looking for
MAPS6301S2, and it is returning MAPS6301S1.
 Result: [APPROVALS   , PGMAPSD1  , MAPS6301S1, Approvals -
MAPS6301S1,  ,   ,   ,
,
  ,  ]

So i changed this query to use parameterMap as below








SELECT TYPE, AS400NAME, ENVNAME, ENVDESC, DISABLED, INIPROG,
INIPGMLIB, USERID, PASS_WRD, MAPSLOGINR FROM EnvNames WHERE TYPE =? and
AS400NAME =? and ENVNAME=?


When i pass the same parameters in Map i get null as result set, which is
what i am expecting,
any idea why this is happening

Ashish


Re: Best practice for using Ibatis in Web application

2008-12-02 Thread Ashish Kulkarni
HiAny ideas on the mail below

On Fri, Nov 7, 2008 at 10:17 AM, Ashish Kulkarni <
[EMAIL PROTECTED]> wrote:

> HiIs there any standard way or best practice for of using Ibatis in web
> application,
> This is how i use it
> In my InitServlet which is loaded when the application starts, i create
> instance SqlMapClient and save it in ServletContext.
> And in other servlets where i need to get data from database, i get the
> SqlMapClient from ServletConext and use it
>
> I think by doing this, SqlMapClient will automatically create
> ConnectionPool and use this connection pool for running queries
>
> public class InitServlet extends javax.servlet.http.HttpServlet
> {
>  public void init(ServletConfig config)
> {
>  super.init(config);
>  ServletContext oCtx = config.getServletContext();
>  String resource = "SQLMapConfigWeb.xml";
>  Reader reader = Resources.getResourceAsReader(resource);
>  SqlMapClient sqlMap =
> SqlMapClientBuilder.buildSqlMapClient(reader);
>  oCtx.setAttribute("SQLMAPCLIENT", sqlMap );
> }
> }
>
>
> public class DataAccessServlet extends javax.servlet.http.HttpServlet
> {
>  public void doGet(javax.servlet.http.HttpServletRequest request,
> javax.servlet.http.HttpServletResponse response)
> throws javax.servlet.ServletException, java.io.IOException
>   {
>  SqlMapClient sqlMap
> =  oCtx.getAttribute("SQLMAPCLIENT", sqlMap );
>  sqlMap.queryForObject("getPerson", personId);
>   }
>
>
> }
>
> //This is my "SQLMapConfigWeb.xml"
>
> 
>  PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
> "http://ibatis.apache.org/dtd/sql-map-config-2.dtd";>
>
> 
>
> file (e.g. "${driver}". The file is usually relative to the classpath and
> is optional. -->
> 
>   lazyLoadingEnabled="true" maxRequests="32" maxSessions="10"
> maxTransactions="5" useStatementNamespaces="false" />
> 
>   
>  
>
>  
>
>  
>
>  
>
>
>
>
>
> 
>
>
>
>
>


Best practice for using Ibatis in Web application

2008-11-07 Thread Ashish Kulkarni
HiIs there any standard way or best practice for of using Ibatis in web
application,
This is how i use it
In my InitServlet which is loaded when the application starts, i create
instance SqlMapClient and save it in ServletContext.
And in other servlets where i need to get data from database, i get the
SqlMapClient from ServletConext and use it

I think by doing this, SqlMapClient will automatically create ConnectionPool
and use this connection pool for running queries

public class InitServlet extends javax.servlet.http.HttpServlet
{
 public void init(ServletConfig config)
{
 super.init(config);
 ServletContext oCtx = config.getServletContext();
 String resource = "SQLMapConfigWeb.xml";
 Reader reader = Resources.getResourceAsReader(resource);
 SqlMapClient sqlMap =
SqlMapClientBuilder.buildSqlMapClient(reader);
 oCtx.setAttribute("SQLMAPCLIENT", sqlMap );
}
}


public class DataAccessServlet extends javax.servlet.http.HttpServlet
{
 public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException, java.io.IOException
  {
 SqlMapClient sqlMap =  oCtx.getAttribute("SQLMAPCLIENT", sqlMap
);
 sqlMap.queryForObject("getPerson", personId);
  }


}

//This is my "SQLMapConfigWeb.xml"


http://ibatis.apache.org/dtd/sql-map-config-2.dtd";>



file (e.g. "${driver}". The file is usually relative to the classpath and is
optional. -->

 

  
 

 

 

 

   
   
   




Issue with creating SqlMapClient using Properties object

2008-10-23 Thread Ashish Kulkarni
HiI am trying to create SqlMapClient using Properties object
I am getting following error, please see my code below

Exception in thread "main" java.lang.NullPointerException
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(SqlMapExecutorDelegate.java:782)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMapSessionImpl.java:176)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapClientImpl.java:154)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction(SqlMapExecutorDelegate.java:883)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:622)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:95)

Properties prop = new Properties();
prop.setProperty("url",
"jdbc:as400:myas400/EXTDB6301;naming=system;date format=iso;time
format=hms;prompt=false");
prop.setProperty("driver", "com.ibm.as400.access.AS400JDBCDriver");
prop.setProperty("username", "userid");
prop.setProperty("password", "password");

String resource = "com/ashishk/test/sql/SQLMapConfigWeb.xml";
Reader reader = Resources.getResourceAsReader(resource);

SqlMapClient sqlMapClient =
SqlMapClientBuilder.buildSqlMapClient(reader, prop);

Map map = new Hashtable();
map.put("SYSTEM", "system");
map.put("AS400USER", "user");
map.put("ENVNAME", "MAPS6305F3");
map.put("P204PORD", 1122);
List poDataList =  sqlMapClient.queryForList("getPOData",map);

My SQLMapConfigWeb.xml is as below


http://ibatis.apache.org/dtd/sql-map-config-2.dtd";>


 

What may be issue, when i create SqlMapClient using Properties file, it
works, but for some reason when i use Properties object i dont get
connection

Ash


Re: Error with ibatis runing queryForList

2008-10-22 Thread Ashish Kulkarni
Hi

This is my code

// Create SQlMapClient

Properties prop = new Properties();
  prop.setProperty("url", url.trim());
  prop.setProperty("driver", driver);
  prop.setProperty("username", userid);
  prop.setProperty("password", password);

String resource = "SQLMapConfigWeb.xml";
Reader reader = Resources.getResourceAsReader(resource);

SqlMapClient sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(reader,
prop);

//SQLConfig xml file




//java code
Map map = new Hashtable();
  map.put("SYSTEM", system);
  map.put("USER",user);
  map.put("ENVNAME",envName);

sqlMapClient.queryForList("getPOHeader",map);
//Sql statement

 SELECT * FROM POHEADER WHERE SYSTEM = #SYSTEM#
  and USER = #USER# and ENVNAME =#ENVNAME#
 

When i change my SQLConfig xml file as below and get the driver url etc
from SqlMapConfig.properties, it works.
What am i missing




  
  

  

  

  

  
  




On Wed, Oct 22, 2008 at 4:16 PM, Yamil Bracho <[EMAIL PROTECTED]>wrote:

>
> Would you mind to us your mapping and java code.. ?
> --
> Date: Wed, 22 Oct 2008 15:55:33 -0400
> From: [EMAIL PROTECTED]
> To: user-java@ibatis.apache.org
> Subject: Error with ibatis runing queryForList
>
> Hi
>
> I am gettig following error when trying to sqlSession.queryForList()
>
>
>  
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(SqlMapExecutorDelegate.java:776)
>  at
> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMapSessionImpl.java:141)
>  at
> com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapClientImpl.java:114)
>  at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction(SqlMapExecutorDelegate.java:860)
>  at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:617)
>  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)
>
>
> what may be the issue
>
>
> --
> Ahora llévate lo mejor de MSN y Windows Live, en tu 
> móvil
>


Error with ibatis runing queryForList

2008-10-22 Thread Ashish Kulkarni
Hi

I am gettig following error when trying to sqlSession.queryForList()

 
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(SqlMapExecutorDelegate.java:776)
 at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMapSessionImpl.java:141)
 at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapClientImpl.java:114)
 at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction(SqlMapExecutorDelegate.java:860)
 at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:617)
 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)

what may be the issue


Re: How to handle null in database

2008-05-19 Thread Ashish Kulkarni
Hi
I changed Hashtable to HashMap and now it works,


On 5/19/08, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
>
> Hi
> I am running following query
>  parameterClass="java.lang.String">
> Select * from Document_Version where UIC_Identity =#value# and PDF_Current
> = 1
> order by Version, Minor_Version
> 
>
> There is column in this database
> called Reprocessing_Scan_Date_Time, which has null values,
> when i do
> sqlMapClient.queryForList("getPDFInfo","item");
> I get following error, how do i handle this situation
>
> Caused by: com.ibatis.common.beans.ProbeException: Could not set property
> 'Reprocessing_Scan_Date_Time' for java.util.Hashtable. Cause:
> java.lang.NullPointerException
> at
> com.ibatis.common.beans.ComplexBeanProbe.setProperty(ComplexBeanProbe.java:355)
> at
> com.ibatis.common.beans.ComplexBeanProbe.setObject(ComplexBeanProbe.java:235)
> at com.ibatis.common.beans.GenericProbe.setObject(GenericProbe.java:90)
> at
> com.ibatis.sqlmap.engine.exchange.ComplexDataExchange.setData(ComplexDataExchange.java:87)
> at
> com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setResultObjectValues(BasicResultMap.java:373)
> at
> com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:64)
> at
> com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:382)
> at
> com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:301)
> at
> com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:190)
> at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
> at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
>
>
>
>
>
>
>


How to handle null in database

2008-05-19 Thread Ashish Kulkarni
Hi
I am running following query

Select * from Document_Version where UIC_Identity =#value# and PDF_Current =
1
order by Version, Minor_Version


There is column in this database
called Reprocessing_Scan_Date_Time, which has null values,
when i do
sqlMapClient.queryForList("getPDFInfo","item");
I get following error, how do i handle this situation

Caused by: com.ibatis.common.beans.ProbeException: Could not set property
'Reprocessing_Scan_Date_Time' for java.util.Hashtable. Cause:
java.lang.NullPointerException
at
com.ibatis.common.beans.ComplexBeanProbe.setProperty(ComplexBeanProbe.java:355)
at
com.ibatis.common.beans.ComplexBeanProbe.setObject(ComplexBeanProbe.java:235)
at com.ibatis.common.beans.GenericProbe.setObject(GenericProbe.java:90)
at
com.ibatis.sqlmap.engine.exchange.ComplexDataExchange.setData(ComplexDataExchange.java:87)
at
com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setResultObjectValues(BasicResultMap.java:373)
at
com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:64)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:382)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:301)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:190)
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)


question about parameterMap and java class

2008-01-03 Thread Ashish Kulkarni
Hi
I have a class like below with get and set method
public ColorClass
{
private String name, desc;

public void setName(String _name)
{
this.name = _name;
}
public String getName()
{
return name;
}

}

How can i define this ColorClass in parameterMap and use it in SQL statement
for varaible substituation.

 

where id is list of ColorClass,

I have a SQL statement as below

select name, id from mytable



C064ID=#id[]#



I want to use getName method to get name of the colorclass,


Java logging API and ibatis

2007-12-04 Thread Ashish Kulkarni
Hi
How can i use java logging API to control logging of ibatis, for example if
i have log4j, i put all the logging information in log4j.xml and from there
i can control what logs i want from ibatis, for example i have added
following lines in log4j.xml








So waht would i do if i am using java.util.Logger for logging


Ashish


Re: Setting up user id, password for JDBC connection

2007-11-26 Thread Ashish Kulkarni
Hi
I tried the following but getting error, any ideas

Properties prop = new Properties();
prop.put("JDBC.Driver", "com.ibm.as400.access.AS400JDBCDriver");
prop.put("JDBC.Username", user);
prop.put("JDBC.Password", password);
prop.put("JDBC.ConnectionURL",
"jdbc:as400:"+as400Name+"/"+library+";naming=system;date format=iso;time
format=hms;prompt=false");

String resource = "com/pfizer/maps/sqlmap/sql/SQLMapConfigAS400.xml";
Reader reader = Resources.getResourceAsReader(resource);
sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(reader, prop);

and in my SQLMapConfigAS400.xml i have














It gives me error, does anyone one have any example for get it working

Ashish





On 11/21/07, Christopher Lamey <[EMAIL PROTECTED]> wrote:
>
> Try creating a properties object, setting the name/value pairs on that,
> and
> passing that into:
>
> public static SqlMapClient buildSqlMapClient(java.io.Reader reader,
> java.util.Properties props)
>
> Cheers,
> Chris
>
> On 11/21/07 2:15 PM, "Ashish Kulkarni" <[EMAIL PROTECTED]>
> wrote:
>
> > Hi
> > I am working on a swing application where the user enters his user id
> and
> > password, then this user id and password is required to create
> SqlMapClient,
> > this is what i am tried but did not work
> > in my sqlconfig.xml file i have
> > 
> > 
> > 
> > 
> > 
> > 
> >
> > And in my java program
> > I do
> > System.setProperty("driver", JDBCdrivername);
> > System.setProperty("url", url);
> > System.setProperty("username", username);
> > System.setProperty("password", password);
> >
> > String resource = "com/pfizer/maps/sqlmap/sql/SQLMapConfigAS400.xml";
> > Reader reader = Resources.getResourceAsReader(resource);
> > SqlMapClient sqlMapClient = SqlMapClientBuilder.buildSqlMapClient
> (reader);
> >
> > Any ideas of how do i get it working in Swing application
> >
> > Ashish
>
>


Setting up user id, password for JDBC connection

2007-11-21 Thread Ashish Kulkarni
Hi
I am working on a swing application where the user enters his user id and
password, then this user id and password is required to create SqlMapClient,
this is what i am tried but did not work
in my sqlconfig.xml file i have







And in my java program
I do
System.setProperty("driver", JDBCdrivername);
System.setProperty("url", url);
System.setProperty("username", username);
System.setProperty("password", password);

String resource = "com/pfizer/maps/sqlmap/sql/SQLMapConfigAS400.xml";
Reader reader = Resources.getResourceAsReader(resource);
SqlMapClient sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(reader);

Any ideas of how do i get it working in Swing application

Ashish


Re: Log file location in Web application

2007-10-04 Thread Ashish Kulkarni
Hi
Sorry i send it to wrong forum, send the question to log4j forum

Ashish

On 10/4/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
>
> Hi
> Can you please let me know where do i look into for this information, any
> hints please
>
> Ashish
>
> On 10/4/07, Larry Meadors < [EMAIL PROTECTED]> wrote:
> >
> > http://logging.apache.org/
> >
> > Larry
> >
> >
> > On 10/4/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> > > Hi
> > > How do we set the log file location dyanamically in web
> > > application,
> > >  Currently i am using log4j.xml file with following definiation, this
> > file
> > > is under WEB-INF file
> > > 
> > >  > >  value="C:\\Documents and Settings\\Kulkara\\My
> > >
> > Documents\\ashish\\code\\workspace5.1M\\version6300build12-00\\log4jXmlFilter.log"
> >
> > > />
> > > ... 
> > > and in load the this xml file in Servlet using
> > >  String fileName = config.getInitParameter(log4j.xml);
> > >  ServletContext oCtx = config.getServletContext();
> > > URL path = oCtx.getResource (fileName);
> > > DOMConfigurator.configure(path);
> > >
> > > But if i have to install this on unix, i have to change
> > > the path, also the server on which i will
> > > install this  may not have the folder, so i will have to recreate a
> > war file
> > > So is there a dynamic way of telling log4j the location and name of
> > log
> > > file? which can work on any system.
> > > i would prefer the log file to be under the same folder application is
> > > installed
> > >
> > > Ashish
> > >
> > >
> > >
> >
>
>


Re: Log file location in Web application

2007-10-04 Thread Ashish Kulkarni
Hi
Can you please let me know where do i look into for this information, any
hints please

Ashish

On 10/4/07, Larry Meadors <[EMAIL PROTECTED]> wrote:
>
> http://logging.apache.org/
>
> Larry
>
>
> On 10/4/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> > Hi
> > How do we set the log file location dyanamically in web
> > application,
> >  Currently i am using log4j.xml file with following definiation, this
> file
> > is under WEB-INF file
> > 
> >  >  value="C:\\Documents and Settings\\Kulkara\\My
> >
> Documents\\ashish\\code\\workspace5.1M\\version6300build12-00\\log4jXmlFilter.log"
> > />
> > ... 
> > and in load the this xml file in Servlet using
> >  String fileName = config.getInitParameter(log4j.xml);
> >  ServletContext oCtx = config.getServletContext();
> > URL path = oCtx.getResource (fileName);
> > DOMConfigurator.configure(path);
> >
> > But if i have to install this on unix, i have to change
> > the path, also the server on which i will
> > install this  may not have the folder, so i will have to recreate a war
> file
> > So is there a dynamic way of telling log4j the location and name of log
> > file? which can work on any system.
> > i would prefer the log file to be under the same folder application is
> > installed
> >
> > Ashish
> >
> >
> >
>


Log file location in Web application

2007-10-04 Thread Ashish Kulkarni
Hi
How do we set the log file location dyanamically in web application,
Currently i am using log4j.xml file with following definiation, this file is
under WEB-INF file


... 
and in load the this xml file in Servlet using
String fileName = config.getInitParameter(log4j.xml);
ServletContext oCtx = config.getServletContext();
URL path = oCtx.getResource(fileName);
DOMConfigurator.configure(path);

But if i have to install this on unix, i have to change the path, also
the server on which i will install this  may
not have the folder, so i will have to recreate a war file
So is there a dynamic way of telling log4j the location and name of log
file? which can work on any system.
i would prefer the log file to be under the same folder application is
installed

Ashish


Re: How to setup JNDI connection in ibatis

2007-09-27 Thread Ashish Kulkarni
Hi
Thank you very much, i changed the parameter in SqlMapConfig.xml to
java:/comp/env/jdbc/AS400B and it works now
I wish this was documented some where in ibatis, or it is and i have never
read it

Ashish
On 9/27/07, Christopher Lamey <[EMAIL PROTECTED]> wrote:
>
> I think the use of the Resource element in the server.xml is the same as
> using the resource-ref element in the web.xml.  From the docs:
>
>  - Configure the name and data type of a resource made
> available to the application (equivalent to the inclusion of a
>  element in the web application deployment descriptor).
>
> So you can probably remove that from your web.xml.
>
> As for the exception you're getting, you might need to use the full JNDI
> name in iBATIS:
>
> java:/comp/env/jdbc/AS400B
>
> If I remember correctly, Tomcat automatically prepends the
> "java:/comp/env/"
> bit to declared JNDI resources.
>
> Cheers,
> Chris
>
> On 9/27/07 9:32 AM, "Ashish Kulkarni" <[EMAIL PROTECTED]> wrote:
>
> > Hi
> > This is what i have done,
> > in my server.xml file i have added in host element
> >  > reloadable="true" crossContext="true">
> >  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" />
> > 
> >
> > Then in web.xml i have added
> > 
> >   DB Connection
> >jdbc/AS400B
> >javax.sql.DataSource
> >Container
> > 
> >
> > and in SqlMapConfig.xml i have added
> > 
> > 
> >
> > 
> > 
> >
> > When i start tomcat i get the following error
> > com.ibatis.sqlmap.client.SqlMapException: There was an error configuring
> > JndiDataSourceDaoTransactionPool. Cause:
> javax.naming.NameNotFoundException:
> > Name jdbc is not bound in this Context
> >
> >
> >
> >
> >
> >
> >
> > On 9/27/07, Christopher Lamey <[EMAIL PROTECTED]> wrote:
> >>
> >> Hello,
> >>
> >> You then need to add a ResourceLink either in conf/context.xml or in
> the
> >> webapp's specific context file (if you're using one).
> >>
> >> I don't know what version of Tomcat you're using, but here are the JNDI
> >> docs
> >> for 5.5:
> >>
> >> http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html
> >>
> >> PS: I think you can add a resource-env-ref to your webapp's web.xml to
> >> link
> >> to the global JNDI resource too, but I usually go with the ResourceLink
> in
> >> the context files to avoid mucking with web.xml.
> >>
> >> Cheers,
> >> Chris
> >>
> >> On 9/27/07 7:58 AM, "Ashish Kulkarni" <[EMAIL PROTECTED]>
> wrote:
> >>
> >>> 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
> >>>
> >>>  >>> 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 <[EMAIL PROTECTED]> 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
> >>>>> 
> >>>>> 
> >>>>>   
> >>>>> 
> >>>>> 
> >>>>>
> >>>>> But i g

Re: How to setup JNDI connection in ibatis

2007-09-27 Thread Ashish Kulkarni
Hi
This is what i have done,
in my server.xml file i have added in host element




Then in web.xml i have added

  DB Connection
   jdbc/AS400B
   javax.sql.DataSource
   Container


and in SqlMapConfig.xml i have added


   



When i start tomcat i get the following error
com.ibatis.sqlmap.client.SqlMapException: There was an error configuring
JndiDataSourceDaoTransactionPool. Cause: javax.naming.NameNotFoundException:
Name jdbc is not bound in this Context







On 9/27/07, Christopher Lamey <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> You then need to add a ResourceLink either in conf/context.xml or in the
> webapp's specific context file (if you're using one).
>
> I don't know what version of Tomcat you're using, but here are the JNDI
> docs
> for 5.5:
>
> http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html
>
> PS: I think you can add a resource-env-ref to your webapp's web.xml to
> link
> to the global JNDI resource too, but I usually go with the ResourceLink in
> the context files to avoid mucking with web.xml.
>
> Cheers,
> Chris
>
> On 9/27/07 7:58 AM, "Ashish Kulkarni" <[EMAIL PROTECTED]> wrote:
>
> > 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
> >
> >  > 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 <[EMAIL PROTECTED]> 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
> >>> 
> >>> 
> >>>   
> >>> 
> >>> 
> >>>
> >>> 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(
> >> SqlMapConfigParser.java:81)
> >>> at
> >>> com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(
> >> SqlMapClientBuilder.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.java:1105)
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> On 9/26/07, *Ashish Kulkarni* <[EMAIL PROTECTED]
> >>> <mailto:[EMAIL PROTECTED]>> 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
> >>>
> >>> 
> >>> 
> >>> 
> >>> 
> >>>
> >>> 
> >>>
> >>> 
> >>>
> >>> 
> >>> 
> >>> 
> >>>
> >>> 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
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
>
>


Re: How to setup JNDI connection in ibatis

2007-09-27 Thread Ashish Kulkarni
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




On 9/26/07, Richard Yee <[EMAIL PROTECTED]> 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
> > 
> > 
> >   
> > 
> > 
> >
> > 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(
> SqlMapConfigParser.java:81)
> > at
> > com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(
> SqlMapClientBuilder.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.java:1105)
> >
> >
> >
> >
> >
> > On 9/26/07, *Ashish Kulkarni* <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> 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
> >
> > 
> > 
> > 
> > 
> >
> > 
> >
> > 
> >
> > 
> > 
> > 
> >
> > 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
> >
> >
> >
> >
> >
> >
>
>


Re: How to setup JNDI connection in ibatis

2007-09-26 Thread Ashish Kulkarni
Hi
I did modify this to look like below


  



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(
SqlMapConfigParser.java:81)
at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(
SqlMapClientBuilder.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.java
:1105)





On 9/26/07, Ashish Kulkarni <[EMAIL PROTECTED]> 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
>
> 
> 
> 
> 
>
> 
>
> 
>
> 
> 
> 
>
> 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
>
>
>
>
>
>


How to setup JNDI connection in ibatis

2007-09-26 Thread Ashish Kulkarni
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














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


Re: ibatis in web application

2007-09-26 Thread Ashish Kulkarni
Hi
I don't mind restarting the web
application, but in weblogic, some times the temp files are deleted,
so i loose all the changes done to the properties file, this is very weird
situation, as it works fine in websphere, tomcat, but causing issue with
weblogic,
Does any one face this situation,

Ashish


On 9/26/07, Kenny Pearce < [EMAIL PROTECTED]> wrote:
>
> What you are doing should work fine. However, depending on where you
> initialize your ibatis client in your servlet code, you may have to
> restart your web application after modifying the file.
>
> Ashish Kulkarni wrote:
> > Hi
> > I need some information about using ibatis in web application, i am
> > using sql maps for java. i have SqlMapConfig.xml and
> > SqlMapConfig.properties file under src folder,
> > SqlMapConfig.properties has database connection information,
> >
> > Now the question is when i create the war file, i do not know what
> > database it is going to connect, so normally i would install this war
> > file and then change the SqlMapConfig.properties file ( which is under
> > WEB-INF\classes) after installing it on application server.
> >
> > Is this the right way to do it, since i am having issues in doing so
> > with weblogic,
> > What is the standard practise, or do i have to create war file after i
> > get the database information, which will be very difficult.
> >
> >
> > Ashish
> >
> >
> >
>
> --
> Kenny Pearce
> Hx Technologies
>


Re: ibatis in web application

2007-09-26 Thread Ashish Kulkarni
Hi
I do not know the JNDI name when creating war file also, so i will have to
change it after installing web application anyway,

Ashish

On 9/26/07, Christopher Lamey <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> Another route is to configure your database connection information via a
> DataSource in JNDI.  Then your webapp just references the JNDI name
> (something like java:/comp/env/jdbc/OrderDS) and you can change it as you
> like outside the webapp.
>
> Lookup JNDI DataSource in your weblogic docs to see more.
>
> Cheers,
> Chris
>
> On 9/26/07 12:56 PM, "Ashish Kulkarni" <[EMAIL PROTECTED]>
> wrote:
>
> > Hi
> > I need some information about using ibatis in web application, i am
> using
> > sql maps for java. i have SqlMapConfig.xml and SqlMapConfig.propertiesfile
> > under src folder,
> > SqlMapConfig.properties has database connection information,
> >
> > Now the question is when i create the war file, i do not know what
> database
> > it is going to connect, so normally i would install this war file and
> then
> > change the SqlMapConfig.properties file ( which is under
> WEB-INF\classes)
> > after installing it on application server.
> >
> > Is this the right way to do it, since i am having issues in doing so
> with
> > weblogic,
> > What is the standard practise, or do i have to create war file after i
> get
> > the database information, which will be very difficult.
> >
> >
> > Ashish
>
>


ibatis in web application

2007-09-26 Thread Ashish Kulkarni
Hi
I need some information about using ibatis in web application, i am using
sql maps for java. i have SqlMapConfig.xml and SqlMapConfig.properties file
under src folder,
SqlMapConfig.properties has database connection information,

Now the question is when i create the war file, i do not know what database
it is going to connect, so normally i would install this war file and then
change the SqlMapConfig.properties file ( which is under WEB-INF\classes)
after installing it on application server.

Is this the right way to do it, since i am having issues in doing so with
weblogic,
What is the standard practise, or do i have to create war file after i get
the database information, which will be very difficult.


Ashish


Re: Dynamic Mapped Statements and Iterate question

2007-09-16 Thread Ashish Kulkarni
Hi
I got it working

this is how i defined








select * from table

  
   code=#notes[]#
  
and view =#view#






On 9/16/07, Richard Yee <[EMAIL PROTECTED]> wrote:
>
> Ashish,
> Did you read the documentation? What have you tried so far?
>
> -Richard
>
>
> Ashish Kulkarni wrote:
> > Hi
> > I have a question about using Dynamic Mapped Statements and Iterate tag
> >
> > I have a table with columns,
> > view
> > code
> > color
> >
> > I have an sql statement like below which i have to convert to dynamic
> > mapped statement
> >
> > select color from table where view=? and code in (?,?,?)
> >
> > But the code in must be dynamic, for example user may select 3 code,
> > or 100 code from the jsp select page.
> >
> > How do i convert the above statement into Dynamic Mapped Statement, (
> > There are 2 input parameters, view and code)
> >
> >
> > Ashish
> >
> >
>
>


Dynamic Mapped Statements and Iterate question

2007-09-16 Thread Ashish Kulkarni
Hi
I have a question about using Dynamic Mapped Statements and Iterate tag

I have a table with columns,
view
code
color

I have an sql statement like below which i have to convert to dynamic mapped
statement

select color from table where view=? and code in (?,?,?)

But the code in must be dynamic, for example user may select 3 code, or 100
code from the jsp select page.

How do i convert the above statement into Dynamic Mapped Statement, ( There
are 2 input parameters, view and code)


Ashish


Question about SQL

2007-09-13 Thread Ashish Kulkarni
Hi
I have a sql statment like

select * from mytable where line in ('ABC', 'XYZ')

where this SQL
statement is going to extact all rows where line is ABC and XYZ,

but now the problem is i do not know if there are going to be only one line
or 2 or 10, so i thought i would define the sql as

select * from mytable where line in ?

and then i created a string like ('ABC', 'XYZ') and passed it as input
parameter, but it does now work,

Any ideas for a work around this solution


Ashish


Re: Ibatis and JakartaCommonsLoggingImpl logging question

2007-08-24 Thread Ashish Kulkarni
Hi
What is the effect of removing commons-logging from classpath?

On 8/24/07, Jeff Butler <[EMAIL PROTECTED]> wrote:
>
> You need to configure JCL.  This could be as simple as following the
> instructions found here:
>
> http://commons.apache.org/logging/
>
> Or, depending on your operating environment, you may need to do some other
> work.  For example, WebSphere supplies it's own implementation of JCL that
> must be configured from the administrative console.
>
> Jeff Butler
>
>
> On 8/24/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> >
> > Hi
> > I am using ibatis 2.1.5 , and setting log file is only for 2.2 and
> > above.
> > so i cannot use it, but there are no ibatis debug logs, but logs
> > from JakartaCommonsLoggingImpl
> > Is there some thing i need to add to log file to contral logging by this 
> > class
> >
> >
> > Ashish
> >
> > On 8/23/07, Jeff Butler <[EMAIL PROTECTED] > wrote:
> > >
> > > Jakarta Commons Logging (JCL) must be in your classpath somewhere.  By
> > > default, iBATIS will use JCL if it finds it.
> > >
> > > If you want to force Log4j, then you'll need to tell iBATIS to use
> > > Log4j even if it finds JCL.
> > >
> > > This is documented on page 62 of the developer's guide.
> > >
> > > Jeff Butler
> > >
> > >
> > > On 8/23/07, Ashish Kulkarni <[EMAIL PROTECTED] > wrote:
> > > >
> > > > Hi
> > > > I am using log4j for logging and added the following XML elements in
> > > > my configuration file, but i still get the log file as below, how do i
> > > > supress these logs from coming in stdout file
> > > >
> > > > 2007-08-23 16:50:12,935 DEBUG [http-4080-Processor25]
> > > > jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23)
> > > > - {conn-10} Connection
> > > > 2007-08-23 16:50:13,095 DEBUG [http-4080-Processor25]
> > > > jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23)
> > > > - {pstm-11} PreparedStatement:
> > > > 2007-08-23 16:50:13,095 DEBUG [http-4080-Processor25]
> > > > jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23)
> > > > - {pstm-11} Parameters: [ASHXXX]
> > > > 2007-08-23 16:50:13,095 DEBUG [http-4080-Processor25]
> > > > jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23)
> > > > - {pstm-11} Types: [java.lang.String]
> > > > 2007-08-23 16:50:13,255 DEBUG [http-4080-Processor25]
> > > > jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23) - 
> > > > {rset-12} ResultSet
> > > >
> > > >
> > > > 
> > > >   
> > > >   
> > > > 
> > > > 
> > > >  
> > > >  
> > > > 
> > > >
> > > >
> > >
> >
>


Re: Ibatis and JakartaCommonsLoggingImpl logging question

2007-08-24 Thread Ashish Kulkarni
Hi
I am using ibatis 2.1.5 , and setting log file is only for 2.2 and above.
so i cannot use it, but there are no ibatis debug logs, but logs
from JakartaCommonsLoggingImpl
Is there some thing i need to add to log file to contral logging by this class

Ashish

On 8/23/07, Jeff Butler <[EMAIL PROTECTED]> wrote:
>
> Jakarta Commons Logging (JCL) must be in your classpath somewhere.  By
> default, iBATIS will use JCL if it finds it.
>
> If you want to force Log4j, then you'll need to tell iBATIS to use Log4j
> even if it finds JCL.
>
> This is documented on page 62 of the developer's guide.
>
> Jeff Butler
>
>
> On 8/23/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> >
> > Hi
> > I am using log4j for logging and added the following XML elements in my
> > configuration file, but i still get the log file as below, how do i supress
> > these logs from coming in stdout file
> >
> > 2007-08-23 16:50:12,935 DEBUG [http-4080-Processor25]
> > jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23) -
> > {conn-10} Connection
> > 2007-08-23 16:50:13,095 DEBUG [http-4080-Processor25]
> > jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23) -
> > {pstm-11} PreparedStatement:
> > 2007-08-23 16:50:13,095 DEBUG [http-4080-Processor25]
> > jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23) -
> > {pstm-11} Parameters: [ASHXXX]
> > 2007-08-23 16:50:13,095 DEBUG [http-4080-Processor25]
> > jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23) -
> > {pstm-11} Types: [java.lang.String]
> > 2007-08-23 16:50:13,255 DEBUG [http-4080-Processor25]
> > jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java :23) -
> > {rset-12} ResultSet
> >
> >
> > 
> >   
> >   
> > 
> > 
> >  
> >  
> > 
> >
> >
>


Ibatis and JakartaCommonsLoggingImpl logging question

2007-08-23 Thread Ashish Kulkarni
Hi
I am using log4j for logging and added the following XML elements in my
configuration file, but i still get the log file as below, how do i supress
these logs from coming in stdout file

2007-08-23 16:50:12,935 DEBUG [http-4080-Processor25]
jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23) -
{conn-10} Connection
2007-08-23 16:50:13,095 DEBUG [http-4080-Processor25]
jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23) -
{pstm-11} PreparedStatement:
2007-08-23 16:50:13,095 DEBUG [http-4080-Processor25]
jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23) -
{pstm-11} Parameters: [ASHXXX]
2007-08-23 16:50:13,095 DEBUG [http-4080-Processor25]
jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23) -
{pstm-11} Types: [java.lang.String]
2007-08-23 16:50:13,255 DEBUG [http-4080-Processor25]
jakarta.JakartaCommonsLoggingImpl (JakartaCommonsLoggingImpl.java:23) -
{rset-12} ResultSet



  
  


 
 



Re: Caching data requirement.

2007-06-11 Thread Ashish Kulkarni

Hi
I can use stored procedure to read this data, but i would like to store it
in java( basically this is a web application ) so store this in a
ServletContext or some where and update it when ever there is change in this
data.
if was wondering if ibatis can be any help in doing so


On 6/10/07, Larry Meadors <[EMAIL PROTECTED]> wrote:


I'd look for a way to make the database do this - any solution on the
Java side will be inherently out-of-date.

Can you do this in a stored procedure?

Larry


On 6/10/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> Hi
> I have a situation where i have a table of about 16,000. rows, which i
need
> to use for mathematical calculation.
> i want to cache the data and this data should update as soon as the
database
> is updated.
>
> Database is updated by external process, so Java program does not  know
if
> there  is update by some other process.
>
> Is it possible to do this requirement using ibatis, any suggestions
>
> Ashish
>
>
>
>



Caching data requirement.

2007-06-10 Thread Ashish Kulkarni

Hi
I have a situation where i have a table of about 16,000. rows, which i need
to use for mathematical calculation.
i want to cache the data and this data should update as soon as the database
is updated.

Database is updated by external process, so Java program does not  know if
there  is update by some other process.

Is it possible to do this requirement using ibatis, any suggestions

Ashish


Re: checking for Database changes

2007-06-04 Thread Ashish Kulkarni

Hi
The problem is, i can put a trigger on database, but what happens is if the
java process fails, there is no way to resubmit this process, so those
records will be in database for ever,
so the work around is to have java process monitor database and process
records as soon as they enter the database.

any suggestions on the issue

On 6/4/07, Nathan Maves <[EMAIL PROTECTED]> wrote:


Hmmm...

My first thought is to let the database do this for you.  I would use a
trigger on the tables that you are watching.  At that point you can trigger
events as they come in.  With out a little more background on the problem
statement I am not sure how much help we can give.

Nathan

On 6/1/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
>
> Hi
> I have a requirement where i have to constantly monitor a database for
> changes, for example if thers is an row added, or row changed the java
> program will process those records.
> is there any good way of doing it, currently i am thinking of writing a
> TimerTask which will sleep for 5-10 seconds to read the database.
> I have a flag in database which is updated when it is processed, so i
> need to monitor for all the rows where this flag is not updated.
>
> any ideas?
>
> Ashish
>




checking for Database changes

2007-06-01 Thread Ashish Kulkarni

Hi
I have a requirement where i have to constantly monitor a database for
changes, for example if thers is an row added, or row changed the java
program will process those records.
is there any good way of doing it, currently i am thinking of writing a
TimerTask which will sleep for 5-10 seconds to read the database.
I have a flag in database which is updated when it is processed, so i need
to monitor for all the rows where this flag is not updated.

any ideas?

Ashish


Get XML as resultClass from Ibatis issue

2007-04-17 Thread Ashish Kulkarni

Hi
I have following definition in my sql-map file


   SELECT M009D as INCOTERMDESCGR FROM pu1012 , cf1009 WHERE PCPORD =
#value# and M009KY = '3T1'concat PCINCO


I run the query as below

List list = sqlMapClient.queryForList("getINCOTERMSGR", new
BigDecimal("20"));

I was expecting that list will be filled with Document objects,  Inside list
is filled String objects.

Is this how it works, or am i doing some thing wrong?


Ashish


Re: ibatis to return xml instead of arraylist (of hashmap).

2007-03-20 Thread Ashish Kulkarni

Hi
I would be interested in the solution you provided where i can create XML
file from HashMap.
I was using ibtaits and type=XML , but hit an issue when there are some
German characters like umlaut in the database,
here is a email i had send, but did not got any reply for it
http://www.nabble.com/Error-When-creating-XML-file-from-Database-with-Character-conversion-error-tf3409773.html#a9499524

So i want to develop some code where in i can convert HashMap to XML String.

I am not sure how do i call the code you have specified,  for example i
would do the following to get the HashMap,
But when do i call this code MapToXmlRowHandler?

Here is what i would do
in java
  List list = client.queryForList("getFooter4", new BigDecimal(3));
in ibatis

   SELECT P704SPEC, P704LINE, P704DETL, P704USER, P704DATE, P704TIME
FROM PU27041 WHERE P704SPEC = #value#


But where do i write this code to convert HashMap into XML

Regards
Ashish
On 3/16/07, netsql <[EMAIL PROTECTED]> wrote:


No, I have not tried that yet.
I was doing something similar to what Larry showed.
But now I am switching to type=XML.

I did not like having to jack w/ Xstream re-mapping.
THANK YOU!
.V
ps: and congrats on the book, I saw it at a bookstore. If anyone goes to
SF for Javaone or otherwise, ping me at vic at pointcast dot com.

On 3/15/07, Clinton Begin <[EMAIL PROTECTED]> wrote:
>
> Vic,
>
> I'm assuming you've already tried  to get a
> list of XML documents back?
>
> Clinton
>
> On 3/15/07, Larry Meadors <[EMAIL PROTECTED] > wrote:
> >
> > Vic,
> >
> > You could write a row handler to take the returned maps and a string
> > builder to create xml.
> >
> > One class would handle all of your requirements.
> >
> > Something like this is close - testing is an exercise left to the
> > reader. ;-)
> >
> > ===
> > public class MapToXmlRowHandler
> > implements RowHandler
> > {
> > private String wrapper;
> > private String item;
> > private StringBuilder builder;
> >
> >
> > public MapToXmlRowHandler(String wrapper, String item) {
> > this.wrapper = wrapper;
> > this.item = item;
> > builder = new StringBuilder();
> > }
> >
> > public void handleRow(Object object) {
> > Map m = (Map) object;
> >
> > builder.append("<").append(item).append(">");
> >
> > for(String key : m.keySet()){
> > // todo: make sure these values are xml friendly
> > builder.append ("<").append(key).append(">")
> >.append(m.get(key))
> >.append("");
> > }
> >
> > builder.append ("");
> > }
> >
> > public String getResultsAsXml(){
> > StringBuilder result = new StringBuilder("<" + wrapper + ">")
> > .append(builder)
> > .append("");
> > return result.toString();
> > }
> >
> > }
> > ===
> >
> > Larry
> >
> >
> > On 3/15/07, netsql < [EMAIL PROTECTED]> wrote:
> > > In the past I allways returned arraylist of hashmap and that works
> > EXCLENT.
> > >
> > > I now want to return xml. I saw some notes on xstream and it works
> > but not
> > > so well, I do not like the xml it makes.
> > >
> > > Is there snipets or more ideas to help me?
> > >
> > > tia,
> > > .V
> > >
> >
>
>



Re: ibatis, XML and special characters

2007-03-20 Thread Ashish Kulkarni

Hi
It is a German Language character umlaut
here is more information about it
http://en.wikipedia.org/wiki/Germanic_umlaut

I try to change the database driver encoding, i am using DB2 on As400 as
database, and see if it works.

But the feature in ibatis to change encoding on DOM builder will be great,
specially if you dealing with non - english database.

Ashish

On 3/19/07, Clinton Begin <[EMAIL PROTECTED]> wrote:


Yeah, that's definitely a character encoding mismatch.  You can either set
your database driver to a different encoding (check your docs), or we could
possibly introduce a feature in iBATIS that will let you set the encoding on
the DOM builder so that it understands whichever character is causing the
problem.

Which character is it though?  It almost looks like it was complaining
about -- (double dashes), which are reserved for closing comments IIRC.

Clinton



On 3/19/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
>
> Hi
> I have posted another thread with detail explaination
> this is the thread
> http://www.nabble.com/forum/ViewPost.jtp?post=9499524&framed=y
>
> if you can take a look and tell me if you have any solution for it
>
> Ashish
>
> On 3/18/07, j-lists < [EMAIL PROTECTED]> wrote:
> >
> > I would guess that this is a database encoding problem, have you
> > confirmed that the ">"s are causing a problem or just the non-ascii
> > characters? If the driver is getting generating invalid UTF16 for Java
> > (internally) that might be causing the failure... unfortunately this
> > is a real pain to debug and fix. Bulk loaders can fill varchars with
> > badly encoded text that give trouble.
> >
> > Just a theory.
> > -J
> >
> > On 3/12/07, Yuvraj Shinde < [EMAIL PROTECTED]> wrote:
> > >
> > >
> > >
> > >
> > > You can use CDATA tag.
> > >
> > >
> > >
> > >  
> > >
> > >
> > > From: Ashish Kulkarni [mailto: [EMAIL PROTECTED]
> > >  Sent: Monday, March 12, 2007 5:47 AM
> > >  To: user-java@ibatis.apache.org
> > >  Subject: ibatis, XML and special characters
> > >
> > >
> > >
> > >
> > > Hi
> > >  I am using ibatis to run a SQL statement which returns a XML as
> > output as
> > > shown below,
> > >
> > >   > > parameterClass="java.math.BigDecimal"
> > > xmlResultName="ITEMSPECIALNOTES">
> > >  SELECT P706DETL as SPECIALNOTE , PDLINE as PDLINENOTES FROM
> > PU1706,
> > > PU1013 WHERE P706ORD = PDPORD and PDSPEC = P706SPEC and PDPORD =
> > #value#
> > > order by P706LINE
> > >  
> > >
> > >
> > >  I am having issues when the data returned by SQL statement has
> > special
> > > characters like > or umlots ü,
> > >  how do i handle this, is there a way to tell ibatis to parse these
> > special
> > > characters and make it XML complaint before creating XML result
> > >
> > >  Ashish
> >
>
>



Re: ibatis, XML and special characters

2007-03-19 Thread Ashish Kulkarni

Hi
I have posted another thread with detail explaination
this is the thread
http://www.nabble.com/forum/ViewPost.jtp?post=9499524&framed=y

if you can take a look and tell me if you have any solution for it

Ashish

On 3/18/07, j-lists <[EMAIL PROTECTED]> wrote:


I would guess that this is a database encoding problem, have you
confirmed that the ">"s are causing a problem or just the non-ascii
characters? If the driver is getting generating invalid UTF16 for Java
(internally) that might be causing the failure... unfortunately this
is a real pain to debug and fix. Bulk loaders can fill varchars with
badly encoded text that give trouble.

Just a theory.
-J

On 3/12/07, Yuvraj Shinde <[EMAIL PROTECTED]> wrote:
>
>
>
>
> You can use CDATA tag.
>
>
>
>  
>
>
> From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]
>  Sent: Monday, March 12, 2007 5:47 AM
>  To: user-java@ibatis.apache.org
>  Subject: ibatis, XML and special characters
>
>
>
>
> Hi
>  I am using ibatis to run a SQL statement which returns a XML as output
as
> shown below,
>
>   parameterClass="java.math.BigDecimal"
> xmlResultName="ITEMSPECIALNOTES">
>  SELECT P706DETL as SPECIALNOTE , PDLINE as PDLINENOTES FROM
PU1706,
> PU1013 WHERE P706ORD = PDPORD and PDSPEC = P706SPEC and PDPORD = #value#
> order by P706LINE
>  
>
>
>  I am having issues when the data returned by SQL statement has special
> characters like > or umlots ü,
>  how do i handle this, is there a way to tell ibatis to parse these
special
> characters and make it XML complaint before creating XML result
>
>  Ashish



Error When creating XML file from Database with Character conversion error

2007-03-15 Thread Ashish Kulkarni

Hi
I am using ibatis to create XML file from database, i have the following
sqlMap


   SELECT P704SPEC, P704LINE, P704DETL, P704USER, P704DATE, P704TIME
FROM PU27041 WHERE P704SPEC = #value#


This works fine, but some times P704DETL has german characters like  Ö
(umlout) in this case the program fails and gives the following error

org.xml.sax.SAXParseException: Character conversion error: "Malformed UTF-8
char -- is an XML encoding declaration missing?" (line number may be too
low).
   at org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1100)
   at org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1072)
   at org.apache.crimson.parser.InputEntity.isXmlDeclOrTextDeclPrefix(
InputEntity.java:914)
   at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:1183)
   at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:653)
   at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
   at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
   at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(
DocumentBuilderImpl.java:185)
   at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:76)
   at com.ashishk.test.data.TestGetXMLData.(TestGetXMLData.java:37)
   at com.ashishk.test.data.TestGetXMLData.main(TestGetXMLData.java:74)


Is there a work around with this issue,


Ashish


Re: ibatis, XML and special characters

2007-03-11 Thread Ashish Kulkarni

Hi
The problem is with the data coming from database, in database they have
special characters, so when ibatis runs the SQL statement and converts it to
XML it does not work because of these characters in the data

Ashish

On 3/11/07, Clinton Begin <[EMAIL PROTECTED]> wrote:


Use a CDATA section, or < > etc...

It's just XML.  ;-)

On 3/11/07, Ashish Kulkarni < [EMAIL PROTECTED]> wrote:
>
> Hi
> I am using ibatis to run a SQL statement which returns a XML as output
> as shown below,
>
> 
> SELECT P706DETL as SPECIALNOTE , PDLINE as PDLINENOTES FROM
> PU1706, PU1013 WHERE P706ORD = PDPORD and PDSPEC = P706SPEC and PDPORD =
> #value# order by P706LINE
> 
>
>
> I am having issues when the data returned by SQL statement has special
> characters like > or umlots ü,
> how do i handle this, is there a way to tell ibatis to parse these
> special characters and make it XML complaint before creating XML result
>
> Ashish
>




ibatis, XML and special characters

2007-03-11 Thread Ashish Kulkarni

Hi
I am using ibatis to run a SQL statement which returns a XML as output as
shown below,


   SELECT P706DETL as SPECIALNOTE , PDLINE as PDLINENOTES FROM PU1706,
PU1013 WHERE P706ORD = PDPORD and PDSPEC = P706SPEC and PDPORD = #value#
order by P706LINE
   


I am having issues when the data returned by SQL statement has special
characters like > or umlots ü,
how do i handle this, is there a way to tell ibatis to parse these special
characters and make it XML complaint before creating XML result

Ashish


How to suppress log files created by ibatis

2007-03-02 Thread Ashish Kulkarni

Hi
I have a application running on AS400 using ibatis, i am using Log4J for
logging, i am getting a lot of log in my spool file.
for preparedStatement created, resultset etc,
How do i suppress these logs from my Log4j.properties file which i use to
set logging in my application.

Ashish


Re: how to use ibatis to get data from multiple databases

2007-02-14 Thread Ashish Kulkarni

Hi
Is there any source code for using properties when creating sql map client

Ashish

On 2/13/07, Larry Meadors <[EMAIL PROTECTED]> wrote:


Use a properties object when you create the sql map client.

Larry


On 2/13/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> Hi
> I have a web application where i am using ibatis, i have a situation
where i
> want to select the database from where i want to get data.
>
> In this application user will login and select he wants to use
development
> 1, or development 2 or test 1 from a drop down
>
> So if the user selects development1 i want to use database for
development1
> and so on.
>
> But in ibatis i can define only one database in sqlMapConfig.
>
> Also i can define multiple sqlMapConfig files (multiple xml files) one
for
> each database, but then in my servlets i will have to keep track of all
the
> sqlMapConfig
>
> I want to be able to add these database at runtime.
>
> Any ideas how we can do this
>
> Ashish
>



how to use ibatis to get data from multiple databases

2007-02-13 Thread Ashish Kulkarni

Hi
I have a web application where i am using ibatis, i have a situation where i
want to select the database from where i want to get data.

In this application user will login and select he wants to use development
1, or development 2 or test 1 from a drop down

So if the user selects development1 i want to use database for development1
and so on.

But in ibatis i can define only one database in sqlMapConfig.

Also i can define multiple sqlMapConfig files (multiple xml files) one for
each database, but then in my servlets i will have to keep track of all the
sqlMapConfig

I want to be able to add these database at runtime.

Any ideas how we can do this

Ashish


Re: issue with unknown host exception

2007-02-06 Thread Ashish Kulkarni

Hi
Is there any document where i can find what has changed, or how can i
upgrade without breaking existing code?

Ashish

On 2/6/07, Jeff Butler <[EMAIL PROTECTED]> wrote:


Time for an upgrade.  This was fully resolved in iBATIS version 2.1.5 in
July 2005.

Jeff Butler



On 2/6/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
>
> Hi
> This is what i have in release.txt file ibatis-sqlmap-2.jar
> Build Date: 2005/05/16 01:33
> Build Number: 565
>
> --
>  2.1.0 - May 16, 2004
> _
>
> Hope this helps, so what should be the doc type for this verion
>
> Ashish
>
> On 2/6/07, Yee, Richard K CTR DMDC < [EMAIL PROTECTED]>
> wrote:
> >
> >  Ashish,
> > I believe I sent you the wrong DOCTYPE. I sent you the one for the
> > sqlmap config instead of the sqlMap file
> > Try this one.
> > **
> > * >
> > PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
> >
> > "http://ibatis.apache.org/dtd/sql-map-2.dtd";>
> >
> > Which version of iBATIS are you using. This DOCTYPE is for versions
> > after 2.1
> >
> >
> >
> > -Richard
> >
> >  -Original Message-
> > *From:* Ashish Kulkarni [mailto: [EMAIL PROTECTED]
> > *Sent:* Tuesday, February 06, 2007 9:25 AM
> > *To:* user-java@ibatis.apache.org ; [EMAIL PROTECTED]
> > *Subject:* Re: issue with unknown host exception
> >
> >  Hi
> > I tried changing it to
> >  > PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
> > " http://ibatis.apache.org/dtd/sql-map-2.dtd";>
> >
> > But still i get the same error, i have java 1.4.2 on this AS400, so
> > the XML parser must be from java.
> >
> > Also i have these program running on 5 other AS400 boxes with same jar
> > files, but not working on this one,
> >
> > i tried to ping http://ibatis.apache.org but it could not find the
> > server.
> >
> > how do i change it to use system DTD instead of the default.
> >
> > Do you have an example.
> >
> > Regards
> > Ashish
> >
> > On 2/6/07, Larry Meadors <[EMAIL PROTECTED] > wrote:
> > >
> > > It should be resolved in the iBATIS jar file. Are you using an older
> > > version of iBATIS, or the current release?
> > >
> > > Also, it could be the XML parser on the 400..if that is the case,
> > > you
> > > could use a system DTD instead of the default.
> > >
> > > Larry
> > >
> > >
> > > On 2/6/07, Ashish Kulkarni < [EMAIL PROTECTED] > wrote:
> > > > Hi
> > > > I have a java program which uses ibatis to run SQL queries, this
> > > program
> > > > runs on AS400, and on of the AS400 boxes i am getting following
> > > error
> > > >
> > > > Error occurred.  Cause:
> > > > com.ibatis.common.xml.NodeletException: Error parsing XML.
> > > > Caused by: java.net.UnknownHostException : ibatis.apache.org
> > > >
> > > >
> > > >
> > > > The header in my XML file looks like this
> > > >
> > > > 
> > > >  > > > PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
> > > > " http://ibatis.apache.org/dtd/sql-map-config-2.dtd";>
> > > >
> > > > i suspect this AS400 has a firewall which blocks all internet
> > > traffic.
> > > >
> > > > Is this the cause of this problem, is there any work around to get
> > > it
> > > > working on this AS400 machine?
> > > >
> > > > Regards
> > > > Ashish
> > > >
> > >
> >
> >
>



Re: issue with unknown host exception

2007-02-06 Thread Ashish Kulkarni

Hi
This is what i have in release.txt file ibatis-sqlmap-2.jar
Build Date: 2005/05/16 01:33
Build Number: 565

--
2.1.0 - May 16, 2004
_

Hope this helps, so what should be the doc type for this verion

Ashish

On 2/6/07, Yee, Richard K CTR DMDC <[EMAIL PROTECTED]> wrote:


 Ashish,
I believe I sent you the wrong DOCTYPE. I sent you the one for the sqlmap
config instead of the sqlMap file
Try this one.
**
*http://ibatis.apache.org/dtd/sql-map-2.dtd";>

Which version of iBATIS are you using. This DOCTYPE is for versions after
2.1



-Richard

 -Original Message-
*From:* Ashish Kulkarni [mailto:[EMAIL PROTECTED]
*Sent:* Tuesday, February 06, 2007 9:25 AM
*To:* user-java@ibatis.apache.org; [EMAIL PROTECTED]
*Subject:* Re: issue with unknown host exception

Hi
I tried changing it to
http://ibatis.apache.org/dtd/sql-map-2.dtd";>

But still i get the same error, i have java 1.4.2 on this AS400, so the
XML parser must be from java.

Also i have these program running on 5 other AS400 boxes with same jar
files, but not working on this one,

i tried to ping http://ibatis.apache.org but it could not find the server.

how do i change it to use system DTD instead of the default.

Do you have an example.

Regards
Ashish

On 2/6/07, Larry Meadors <[EMAIL PROTECTED]> wrote:
>
> It should be resolved in the iBATIS jar file. Are you using an older
> version of iBATIS, or the current release?
>
> Also, it could be the XML parser on the 400..if that is the case, you
> could use a system DTD instead of the default.
>
> Larry
>
>
> On 2/6/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> > Hi
> > I have a java program which uses ibatis to run SQL queries, this
> program
> > runs on AS400, and on of the AS400 boxes i am getting following error
> >
> > Error occurred.  Cause:
> > com.ibatis.common.xml.NodeletException: Error parsing XML.
> > Caused by: java.net.UnknownHostException : ibatis.apache.org
> >
> >
> >
> > The header in my XML file looks like this
> >
> > 
> >  > PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
> > " http://ibatis.apache.org/dtd/sql-map-config-2.dtd";>
> >
> > i suspect this AS400 has a firewall which blocks all internet traffic.
>
> >
> > Is this the cause of this problem, is there any work around to get it
> > working on this AS400 machine?
> >
> > Regards
> > Ashish
> >
>




Re: issue with unknown host exception

2007-02-06 Thread Ashish Kulkarni

Hi
I tried changing it to
http://ibatis.apache.org/dtd/sql-map-2.dtd";>

But still i get the same error, i have java 1.4.2 on this AS400, so the XML
parser must be from java.

Also i have these program running on 5 other AS400 boxes with same jar
files, but not working on this one,

i tried to ping http://ibatis.apache.org but it could not find the server.

how do i change it to use system DTD instead of the default.

Do you have an example.

Regards
Ashish

On 2/6/07, Larry Meadors <[EMAIL PROTECTED]> wrote:


It should be resolved in the iBATIS jar file. Are you using an older
version of iBATIS, or the current release?

Also, it could be the XML parser on the 400..if that is the case, you
could use a system DTD instead of the default.

Larry


On 2/6/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> Hi
> I have a java program which uses ibatis to run SQL queries, this program
> runs on AS400, and on of the AS400 boxes i am getting following error
>
> Error occurred.  Cause:
> com.ibatis.common.xml.NodeletException: Error parsing XML.
> Caused by: java.net.UnknownHostException: ibatis.apache.org
>
>
>
> The header in my XML file looks like this
>
> 
>  PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
> " http://ibatis.apache.org/dtd/sql-map-config-2.dtd";>
>
> i suspect this AS400 has a firewall which blocks all internet traffic.
>
> Is this the cause of this problem, is there any work around to get it
> working on this AS400 machine?
>
> Regards
> Ashish
>



issue with unknown host exception

2007-02-06 Thread Ashish Kulkarni

Hi
I have a java program which uses ibatis to run SQL queries, this program
runs on AS400, and on of the AS400 boxes i am getting following error

Error occurred.  Cause: com.ibatis.common.xml.NodeletException: Error
parsing XML.
Caused by: java.net.UnknownHostException: ibatis.apache.org


The header in my XML file looks like this


http://ibatis.apache.org/dtd/sql-map-config-2.dtd";>

i suspect this AS400 has a firewall which blocks all internet traffic.

Is this the cause of this problem, is there any work around to get it
working on this AS400 machine?

Regards
Ashish


Re: Issue with Ibatis in Websphere

2006-12-21 Thread Ashish Kulkarni

Hi
Thanks, for now i have changed my code as Jeff suggested and testing it,
still now not seen any major issues, and hope it continues that way.

Ashish

On 12/19/06, Clinton Begin <[EMAIL PROTECTED]> wrote:


Exactly.

This interface isn't perfect either though...I have better ideas.  It's
fine until you need transactions, then you have to nest try/finally blocks
for the session and transaction.  Session never did work out how I expected
in iBATIS, and really it's just a higher level abstraction for a
transaction.  So I'd like to see:  client.startTransaction(myConnection)
implemented that basically does the same thing.  But until then, it's how
Jeff said.

cheers,
Clinton

On 12/18/06, Jeff Butler <[EMAIL PROTECTED]> wrote:
>
> SqlMapSession session = sqlMapClient.openSession(conn);
> try {
>   session.queryForList("getItemFormat","myname");
> } finally {
>   session.close ();
> }
>
> Jeff Butler
>
>
>
> On 12/18/06, Ashish Kulkarni <[EMAIL PROTECTED] > wrote:
> >
> > Hi
> >
> > How do i replace my existing code with
> > sqlMapClient.openSession(myConnection);
> >
> > My excisting code is as below
> >
> > client.setUserConnection(conn);
> >
> > client.queryForList("getItemFormat","myname" );
> >
> > Regards
> > Ashish
> >
> >
> >
> > On 12/18/06, Clinton Begin <[EMAIL PROTECTED] > wrote:
> > >
> > > GACK.. setUserConnection() is another API we should deprecate.
> > >
> > > A cleaner way to do it is:
> > >
> > > SqlMapSession session = sqlMapClient.openSession(myConnection);
> > > try {
> > >   //do work.
> > > } finally {
> > >   session.close ();
> > > }
> > >
> > > Cheers,
> > > Clinton
> > >
> > > On 12/18/06, Jeff Butler < [EMAIL PROTECTED] > wrote:
> > > >
> > > > This is very similar to this issue:
> > > >
> > > > http://issues.apache.org/jira/browse/IBATIS-66
> > > >
> > > > Make sure you're calling client.setUserConnection(null) after
> > > > processing each query.
> > > >
> > > > Jeff Butler
> > > >
> > > >
> > > >
> > > > On 12/18/06, Ashish Kulkarni <[EMAIL PROTECTED] > wrote:
> > > > >
> > > > > Hi
> > > > > I have attached the sqlmap and xml file with all the sql
> > > > > statements along this mail.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On 12/18/06, Larry Meadors <[EMAIL PROTECTED] > wrote:
> > > > > >
> > > > > > Can you post your configuration (database and sqlmap)?
> > > > > >
> > > > > > Larry
> > > > > >
> > > > > >
> > > > > > On 12/18/06, Ashish Kulkarni < [EMAIL PROTECTED]>
> > > > > > wrote:
> > > > > > > Hi
> > > > > > >  We have a web application running in websphere, and for a
> > > > > > while we are
> > > > > > > seeing some hung threads in websphere,
> > > > > > >  do we did some java dump as insturcted by IBM and we are
> > > > > > seeing some of the
> > > > > > > following messages in the dump.
> > > > > > >
> > > > > > >  In our java program before calling SQL statemenet we do the
> > > > > > following
> > > > > > >  SqlMapClient client =// get connection client from servlet
> > > > > > context
> > > > > > >  client.setUserConnection(conn);
> > > > > > >  // do furthr processing of calling SQL statements.
> > > > > > >
> > > > > > >  I am not sure if this is the issue, but this is the
> > > > > > messsage in the dump
> > > > > > >
> > > > > > >com.ibatis.common.util.Throttle.increment seems to be
> > > > > > > currently executing on
> > > > > > >   11 servlet threads.
> > > > > > >   Since 100% (11 out of 11) of the threads doing
> > > > > > servlet work seem
> > > > > > > to be
> > > > > > >   executing this method, it would seem that
> > > > > > there
> > > > > > >   is some possibility that this method and its
> > > > > > call path
> > > > > > >   may warrant investigation.
> > > > > > >   Servlets affected:
> > > > > > >  com.pfizer.maps.servlet.MapsBaseServlet [11
> > > > > > > occurrances]
> > > > > > >   Callers (servlet threads only):
> > > > > > >  com.ibm.ws.util.ThreadPool$Worker.run [5]
> > > > > > >
> > > > > > > com.pfizer.maps.data.planning.GetPlanningData.getTotalData
> > > > > > > [2]
> > > > > > >
> > > > > > > com.pfizer.maps.data.planning.GetProductionData.getTotalData
> > > > > > > [2]
> > > > > > >
> > > > > > >
> > > > > > com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI
> > > > > > > [1]
> > > > > > >
> > > > > > >
> > > > > > com.ibm.ws.webcontainer.servlet.ServicingServletState.service
> > > > > > > [1]
> > > > > > >
> > > > > > >  This is ibaits version
> > > > > > >
> > > > > > >  Implementation-Title: iBatis sql map
> > > > > > >  Implementation-Version: 2.1.5 build# 582
> > > > > > >
> > > > > > >  Can anyone explain what this is, and how can we fix this
> > > > > > >
> > > > > > >  Ashish
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>



Re: Issue with Ibatis in Websphere

2006-12-18 Thread Ashish Kulkarni

Hi

How do i replace my existing code with
sqlMapClient.openSession(myConnection);

My excisting code is as below

client.setUserConnection(conn);

client.queryForList("getItemFormat","myname" );

Regards
Ashish



On 12/18/06, Clinton Begin <[EMAIL PROTECTED]> wrote:


GACK.. setUserConnection() is another API we should deprecate.

A cleaner way to do it is:

SqlMapSession session = sqlMapClient.openSession(myConnection);
try {
  //do work.
} finally {
  session.close ();
}

Cheers,
Clinton

On 12/18/06, Jeff Butler <[EMAIL PROTECTED]> wrote:
>
> This is very similar to this issue:
>
> http://issues.apache.org/jira/browse/IBATIS-66
>
> Make sure you're calling client.setUserConnection(null) after processing
> each query.
>
> Jeff Butler
>
>
>
> On 12/18/06, Ashish Kulkarni <[EMAIL PROTECTED] > wrote:
> >
> > Hi
> > I have attached the sqlmap and xml file with all the sql statements
> > along this mail.
> >
> >
> >
> >
> > On 12/18/06, Larry Meadors <[EMAIL PROTECTED] > wrote:
> > >
> > > Can you post your configuration (database and sqlmap)?
> > >
> > > Larry
> > >
> > >
> > > On 12/18/06, Ashish Kulkarni < [EMAIL PROTECTED]> wrote:
> > > > Hi
> > > >  We have a web application running in websphere, and for a while
> > > we are
> > > > seeing some hung threads in websphere,
> > > >  do we did some java dump as insturcted by IBM and we are seeing
> > > some of the
> > > > following messages in the dump.
> > > >
> > > >  In our java program before calling SQL statemenet we do the
> > > following
> > > >  SqlMapClient client =// get connection client from servlet
> > > context
> > > >  client.setUserConnection(conn);
> > > >  // do furthr processing of calling SQL statements.
> > > >
> > > >  I am not sure if this is the issue, but this is the messsage in
> > > the dump
> > > >
> > > >com.ibatis.common.util.Throttle.increment seems to be
> > > > currently executing on
> > > >   11 servlet threads.
> > > >   Since 100% (11 out of 11) of the threads doing servlet
> > > work seem
> > > > to be
> > > >   executing this method, it would seem that there
> > > >   is some possibility that this method and its call
> > > path
> > > >   may warrant investigation.
> > > >   Servlets affected:
> > > >  com.pfizer.maps.servlet.MapsBaseServlet [11
> > > > occurrances]
> > > >   Callers (servlet threads only):
> > > >  com.ibm.ws.util.ThreadPool$Worker.run [5]
> > > >
> > > > com.pfizer.maps.data.planning.GetPlanningData.getTotalData
> > > > [2]
> > > >
> > > > com.pfizer.maps.data.planning.GetProductionData.getTotalData
> > > > [2]
> > > >
> > > > com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI
> > > > [1]
> > > >
> > > > com.ibm.ws.webcontainer.servlet.ServicingServletState.service
> > > > [1]
> > > >
> > > >  This is ibaits version
> > > >
> > > >  Implementation-Title: iBatis sql map
> > > >  Implementation-Version: 2.1.5 build# 582
> > > >
> > > >  Can anyone explain what this is, and how can we fix this
> > > >
> > > >  Ashish
> > > >
> > > >
> > >
> >
> >
> >
>



Re: Issue with Ibatis in Websphere

2006-12-18 Thread Ashish Kulkarni

Hi
I have attached the sqlmap and xml file with all the sql statements along
this mail.




On 12/18/06, Larry Meadors <[EMAIL PROTECTED]> wrote:


Can you post your configuration (database and sqlmap)?

Larry


On 12/18/06, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> Hi
>  We have a web application running in websphere, and for a while we are
> seeing some hung threads in websphere,
>  do we did some java dump as insturcted by IBM and we are seeing some of
the
> following messages in the dump.
>
>  In our java program before calling SQL statemenet we do the following
>  SqlMapClient client =// get connection client from servlet context
>  client.setUserConnection(conn);
>  // do furthr processing of calling SQL statements.
>
>  I am not sure if this is the issue, but this is the messsage in the
dump
>
>com.ibatis.common.util.Throttle.increment seems to be
> currently executing on
>   11 servlet threads.
>   Since 100% (11 out of 11) of the threads doing servlet work
seem
> to be
>   executing this method, it would seem that there
>   is some possibility that this method and its call path
>   may warrant investigation.
>   Servlets affected:
>  com.pfizer.maps.servlet.MapsBaseServlet [11
> occurrances]
>   Callers (servlet threads only):
>  com.ibm.ws.util.ThreadPool$Worker.run [5]
>
> com.pfizer.maps.data.planning.GetPlanningData.getTotalData
> [2]
>
> com.pfizer.maps.data.planning.GetProductionData.getTotalData
> [2]
>
> com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI
> [1]
>
> com.ibm.ws.webcontainer.servlet.ServicingServletState.service
> [1]
>
>  This is ibaits version
>
>  Implementation-Title: iBatis sql map
>  Implementation-Version: 2.1.5 build# 582
>
>  Can anyone explain what this is, and how can we fix this
>
>  Ashish
>
>


http://www.ibatis.com/dtd/sql-map-config-2.dtd";>




  



  

  
  

http://www.ibatis.com/dtd/sql-map-2.dtd";>







	
	select distinct a.l098phnu from pl1098 a, pl1083 c where a.l098llco in 
		(select Min(b.l098llco) from pl1098 b, pl1083 d where d.l083code = #value# and d.l083line = b.l098plin ) 
		and c.l083line = a.l098plin and c.l083code = #value#
	

	
		Select L081code as name, L081desc  as descrption from pl1081 order by L081code
	
	
	
		select distinct L078Item, L078Atr1, L078Atr2 , L081DESC as format1Desc
		 from Pl1062, Pl1078, PL1081 where
 		l062item = L078item and l062scen =#value# and 
		(L078Atr1  ' ' or L078Atr2  ' ') and  L078Atr1  = L081CODE		
	
	
	
 SELECT distinct l078item, L078ATR1, L078ATR2, L078ATR3,  L081DESC as format1Desc FROM wp1004c, PL1078 , PL1083, PL1081 WHERE w4ccode = L078item
 and L083LINE = W4CLINE and L083CODE = #value# and
 (L078Atr1  ' ' or L078Atr2  ' ') and  L078Atr1  = L081CODE
	
	
	
		select L082CODE, L082DESC from PL1082
	
	
		select L082CODE, L082DESC from PL1082 where L082CODE >= #value# 
	
	
	
		SELECT DISTINCT L062PHNU as name, R871DESC as descrption FROM pl1062, rs1871 WHERE L062SCEN= #value# and L062PLIN
		
		' ' and L062PHNU = R871CODE ORDER BY L062PHNU

	
	
	
		SELECT DISTINCT W4CPHNO as name, R871DESC as descrption
 		FROM wp1004c, PL1083, RS1871  
		where L083LINE =W4CLINE and L083CODE=#value# 
		and W4CPHNO = R871CODE order by W4CPHNO
	
	
	
	SELECT char(W2UKEY)  FROM wp1002 , pl1083, wp1010  
WHERE W2ORDS '2' and W2ORDS   '5' and   
W2FLAG  '2' and  
w010ord = w2ord and
w010line = L083LINE  and   
L083CODE  = #value#  
  
	
	




Issue with Ibatis in Websphere

2006-12-18 Thread Ashish Kulkarni

Hi
We have a web application running in websphere, and for a while we are
seeing some hung threads in websphere,
do we did some java dump as insturcted by IBM and we are seeing some of the
following messages in the dump.

In our java program before calling SQL statemenet we do the following
SqlMapClient client =// get connection client from servlet context
client.setUserConnection(conn);
// do furthr processing of calling SQL statements.

I am not sure if this is the issue, but this is the messsage in the dump

 com.ibatis.common.util.Throttle.increment seems to be currently executing
on
11 servlet threads.
Since 100% (11 out of 11) of the threads doing servlet work seem to
be
executing this method, it would seem that there
is some possibility that this method and its call path
may warrant investigation.
Servlets affected:
   com.pfizer.maps.servlet.MapsBaseServlet [11 occurrances]
Callers (servlet threads only):
   com.ibm.ws.util.ThreadPool$Worker.run [5]
   com.pfizer.maps.data.planning.GetPlanningData.getTotalData [2]
   com.pfizer.maps.data.planning.GetProductionData.getTotalData [2]

com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI [1]
   com.ibm.ws.webcontainer.servlet.ServicingServletState.service[1]

This is ibaits version

Implementation-Title: iBatis sql map
Implementation-Version: 2.1.5 build# 582

Can anyone explain what this is, and how can we fix this

Ashish


Is this the right way to use commitment control

2006-05-02 Thread Ashish Kulkarni
Hi
This is what i am doing in my code and want to confirm that it is the right way to use commitment control
// start commitment control
sqlMapClient.startTransaction();
sqlMapClient.insert("insertCOHeader", coDataBean);
sqlMapClient.insert("insertCOCOmment", coComment);
sqlMapClient.insert("insertCOHeaderNotes", map);
sqlMapClient.insert("insertCOLineNotes", map);
// commit all transcations
sqlMapClient.commitTransaction();

How about dirty read, will this take of it

Ashish


[OT]question about SQLJ

2006-03-13 Thread Ashish Kulkarni
Hi
Has anyone worked with SQLJ, suppose if i have 10 SQLJ
files, how do i use them from java.
How do i compile them?
and call them from java class?

Ashish

A$HI$H

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


[OT]logging using log4j

2006-03-09 Thread Ashish Kulkarni
Hi
I am using ibatis for sql mapping in my web
application, i am also using log4j for logging, 
I have a XML file which i load at startup where I
setup logging parameters and logging levels,
Can i use this XML file to setup ibatis logging
parameters?
Suppose i have to add following line 
log4j.logger.com.ibatis=DEBUG
How do i add it in XML file

Ashish

A$HI$H

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


ibatis and best practices

2006-03-03 Thread Ashish Kulkarni
Hi
Recently i had asked question about designing java
classes for resultset,
So if i have desgined my java classes as per my
requirement, and using java.util.HashMap to get result
using ibatis, and then in my java program loading
values from HashMap in my java class, 
am i not making the process slow by adding additional
layer?

Ashish


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Best way to define java class for mapping

2006-03-01 Thread Ashish Kulkarni
Hi
What is the best way to design java class for mapping,
for example suppose i have a SQL querry which join 2-3
tables and returns the data, 
should i design java class to match this SQL querry,
or should i design java class to match tables, and
then create a Map in xml file and then populate data
in 2-3 tables.

Is there a utility which will create java class from
resultset, 
or is there any utility where i may not have to create
java class, like DynaActionForm in struts

ashish

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: Get ResultSet using ibatis

2006-02-28 Thread Ashish Kulkarni
Hi

I am still not sure how to use
http://issues.apache.org/jira/browse/IBATIS-53 for my
soultion.

This is my real problem and need to find a work around
I have a SQL statement which returns about 50 values,
and there a java class with get and set methods, 
but the data names in SQL statement do not match that
of java class.
for example 

my sql statement is as below

SELECT A AS A, B AS B, C AS C FROM MYTABLE

where as my java class is as below with get and set
methods

public class MyTest
private String first;
private String second;
private String third;

Now i want to Map A to first, B to second and C to
third.

Unfortunaletly i cannot redefine SQL statement or java
class as it is too much effort

Any solution to get it working
(I am trying to modify a old project using ibatis, in
my previous project we used raw JDBC and prepared
statements to get resultset)


Ashish



--- Sven Boden <[EMAIL PROTECTED]> wrote:

> Hi Ashish,
> 
> Have a look at
> http://issues.apache.org/jira/browse/IBATIS-53 for
> some 
> examples of what you can probably use. It's not
> really the primary use 
> of iBATIS, but it works ;-)
> 
> Regards,
> Sven
> 
> Ashish Kulkarni wrote:
> 
> >Hi
> >Is it possible to get Resultset as resultClass
> after
> >running a query
> >Suppose i have a query like below
> >select * from mytable
> >how do i define  in xml file so i can
> get a
> >resultset as output from it
> >I will parse this resultset into objects i need
> >
> >Ashish
> >
> >__
> >Do You Yahoo!?
> >Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> >http://mail.yahoo.com 
> >
> >
> >  
> >
> 
> 


A$HI$H

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Get ResultSet using ibatis

2006-02-28 Thread Ashish Kulkarni
Hi
Is it possible to get Resultset as resultClass after
running a query
Suppose i have a query like below
select * from mytable
how do i define  in xml file so i can get a
resultset as output from it
I will parse this resultset into objects i need

Ashish

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: [OT] Need help with SQL Query

2006-02-24 Thread Ashish Kulkarni
Hi
I used the following sql statement to get it working
select date, time, name from mytable
number=123 order by date, time
FETCH FIRST 1 ROWS ONLY 


--- Nathan Maves <[EMAIL PROTECTED]> wrote:

> A little hasty with my answer...
> 
> The query I gave could give you results from two
> different rows.
> 
> Having a date and time column is problematic.  I
> would just use a  
> date column that included the time or a timestamp.
> 
> If there is only one column to worry about then you
> could do
> 
> select date, name from mytable where number = 123
> and date = (select  
> min(date) from mytable where number = 123)
> 
> nathan
> 
> 
> On Feb 24, 2006, at 9:25 AM, Nathan Maves wrote:
> 
> > You almost had it :)
> >
> > select min(date), min(time), name from mytable
> where number = 123  
> > group by name
> >
> >
> > Nathan
> >
> > On Feb 24, 2006, at 8:58 AM, Ashish Kulkarni
> wrote:
> >
> >> Hi
> >> I have a table with 4 columns number, name, date,
> >> time, it is not unique so can have multiple
> entries
> >> for one name at different date and time.
> >> I need to find out the first instance of name for
> that
> >> number in this table, or get the name with
> minimum
> >> date and time
> >> i can do
> >> select min(date), min(time) from mytable where
> >> number=123
> >> this will give me the min date and time , but how
> can
> >> i get the name also,
> >> for example
> >> select min(date), min(time), name from mytable
> >> number=123
> >> wont work
> >>
> >> Ashish
> >>
> >>
> __
> >> Do You Yahoo!?
> >> Tired of spam?  Yahoo! Mail has the best spam
> protection around
> >> http://mail.yahoo.com
> >
> 
> 


A$HI$H

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


[OT] Need help with SQL Query

2006-02-24 Thread Ashish Kulkarni
Hi
I have a table with 4 columns number, name, date,
time, it is not unique so can have multiple entries
for one name at different date and time.
I need to find out the first instance of name for that
number in this table, or get the name with minimum
date and time
i can do 
select min(date), min(time) from mytable where
number=123
this will give me the min date and time , but how can
i get the name also,
for example
select min(date), min(time), name from mytable
number=123
wont work

Ashish

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


[OT] Utility to create DDL from a database

2006-01-19 Thread Ashish Kulkarni
Hi
Is there any open source utility which i can use to
create DDL from an existing database, so i can use it
to run to create tables on other database.
This utility should be smart enough to create DDL
statements for tables with primary key, before tables
with foreign key.
That way when i run the DDL to create tables on other
database there wont be referential integrity errors.
Is there some thing like this out in market.

Also is there a open source utility to run SQL
statemens againts database 

Ashish

A$HI$H

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


get Vector as queryForList option

2006-01-11 Thread Ashish Kulkarni
Hi
I have defined a query as

SELECT L083LINE FROM PL1083 WHERE L083CODE = #value#
ORDER BY L083SQNO


and in my java code i do 
List list = client.queryForList("selectLinesFromView",
"ABC");

Suppose if i want a Vector as output, i just cannot
parse it as it gives me classcastexception, 
so what is a best way of getting Vector as output, or
do i have to iterate through list and uild my own
vector


Ashish



A$HI$H

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


one more question about Abator

2006-01-10 Thread Ashish Kulkarni
Hi
I did configure Aator and ran to create sql mapping
for 1 table (PODATA), 
it worked but then created on more java class called
(PodataExample) and also in
CXASHTEST_PODATA_SqlMap.xml (CXASHTEST is schema name)
there is a xml tags for 

   


then
 
 
PDBLRF like #pdblrf#
  

  

and then some other things
Is it possible to get only 4 querries as
select column1, column2 from table1 where key =
#value# (where key is the primary key)
and then querry to insert, update and delete.

Also is there a utility which will create a java class
by running a stored procedure or sql statement, and
required setMethods class

Ashish

www.shriayurveda.com


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


how to use abator?

2006-01-10 Thread Ashish Kulkarni
Hi
is there any tutorial on manual about using abator?
I am working on webapplication, i haev a database and
need to write SQL statements for CRUD type of
operations? can i use abator for it

ashish



__ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 



Re: What is the best way to get data from 2 different database having same table names

2005-12-28 Thread Ashish Kulkarni

Larry
What is SMC and how do i create it? 
suppose i have a SQL statement like 
select * from myname.table1 
and similarly have some thing like select * from
diffname.table1
how do i on the fly execute one of the querries
depending on user selection.

table1 has same layout


Ashish
--- Larry Meadors <[EMAIL PROTECTED]> wrote:

> When you create a sql map client, you can pass in a
> properties
> object...that works just exactly like the
>  tag in the
> sql map config xml file.
> 
> So, prompt the user, then create a SMC for them
> based on their
> selection - if you wanted to, you could store the
> SMC in application
> scope based on the key (test1 or test2), and get it
> from there.
> 
> Larry
> 
> 
> On 12/22/05, Ashish Kulkarni
> <[EMAIL PROTECTED]> wrote:
> > Hi
> > I have a situation, in which i have 2 database on
> > suppose DB2, first database is Test1, and second
> is
> > Test2.
> >
> > There is table called names in both databases.
> >
> > I have created JNDI connection in tomcat.
> >
> > Now in my website i want to give user a option to
> > select one of the 2 JNDI connection, and then i
> must
> > be able to run query against that database.
> >
> > For example , if the user selects JNDI ( i will
> show
> > some meaningful name) for Test1 then get the data
> from
> > names in database Test1.
> >
> > What is the best way of doing this, if i am using
> > ibatis SQL Map and DAO
> >
> > Ashish
> >
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> 





__ 
Yahoo! for Good - Make a difference this year. 
http://brand.yahoo.com/cybergivingweek2005/


What is the best way to get data from 2 different database having same table names

2005-12-22 Thread Ashish Kulkarni
Hi
I have a situation, in which i have 2 database on
suppose DB2, first database is Test1, and second is
Test2.

There is table called names in both databases.

I have created JNDI connection in tomcat.

Now in my website i want to give user a option to
select one of the 2 JNDI connection, and then i must
be able to run query against that database.

For example , if the user selects JNDI ( i will show
some meaningful name) for Test1 then get the data from
names in database Test1.

What is the best way of doing this, if i am using
ibatis SQL Map and DAO

Ashish

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


How to define not equal (<>) in SQL statement

2005-12-09 Thread Ashish Kulkarni
Hi
I have a SQL statement as below, how do i define it in
xml 

select * from mytable where mytest <> ' '

When i define it in xml file i get following error

The content beginning "<>" is not legal markup.
Perhaps the ">" (e;) character should be a letter.


Ashish

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


question about using DAO and SQLMap with user specific connection

2005-12-07 Thread Ashish Kulkarni
Hello
If i have to use DAO and SQLMap to get data from my
database, but i want to supply the connection, is it
possible?
for example if i have to just SQLMap i do the
following

SqlMapClient client =
GetSQLConfig.getSqlMapInstance();
client.setUserConnection(conn);

How can i do it when using DAO and SQLMap

Ashish



__ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 



Re: Error when sqlMap has no SQL statements defined

2005-11-18 Thread Ashish Kulkarni
Oh
the reason i am using ibatis is because in my
application i want to make provision to add SQL
statements to get data in XML files in future, so by
default we provide some information, but if our
clients require additional data, they need to define
SQL statements in sqlMap, i have logic which will read
these XML files and get execute the querries and get
the additional data

Ashish

--- Jeff Butler <[EMAIL PROTECTED]> wrote:

> The DTD requires that sqlMap have at least one sub
> element.
>  This is kind of funny - if it is not legel to
> define any SQL, why are you
> using iBATIS? :)
>  Jeff Butler
> 
>  On 11/18/05, Ashish Kulkarni
> <[EMAIL PROTECTED]> wrote:
> >
> > Hello
> > Why do i get following error
> > Caused by:
> > org.xml.sax.SAXParseException: Element "sqlMap"
> > requires additional elements.
> > at java/lang/Throwable.(Throwable.java:195)
> > at java/lang/Exception.(Exception.java:41)
> > at
> >
>
org/xml/sax/SAXException.(SAXException.java:55)
> > at
> >
> >
>
org/xml/sax/SAXParseException.(SAXParseException.java:56)
> > at
> >
> >
>
org/apache/crimson/parser/Parser2.error(Parser2.java:3343)
> > at
> >
>
org/apache/crimson/parser/ValidatingParser$ChildrenValidator.done(
> > ValidatingParser.java:361)
> > at
> >
> >
>
org/apache/crimson/parser/Parser2.maybeElement(Parser2.java:1692)
> >
> > I have the following configuration files
> > 
> >  > SQL
> > Map Config 2.0//EN"
> > "http://www.ibatis.com/dtd/sql-map-config-2.dtd";>
> > 
> > 
> >
> > 
> >
> > And my PODataAS400.xml is as below
> >
> > 
> >  > PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
> > "http://www.ibatis.com/dtd/sql-map-2.dtd";>
> > 
> >
> > 
> >
> > I have not defined any SQL, is it not legal to do
> > so
> >
> > Ashish
> >
> >
> > A$HI$H
> >
> >
> >
> > __
> > Start your day with Yahoo! - Make it your home
> page!
> > http://www.yahoo.com/r/hs
> >
> 




__ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com


Error when sqlMap has no SQL statements defined

2005-11-18 Thread Ashish Kulkarni
Hello
 Why do i get following error
  Caused by: 
  org.xml.sax.SAXParseException: Element "sqlMap"
 requires additional elements.
   at java/lang/Throwable.(Throwable.java:195) 
   at java/lang/Exception.(Exception.java:41)  
   at
 org/xml/sax/SAXException.(SAXException.java:55)
  at

org/xml/sax/SAXParseException.(SAXParseException.java:56)
   at

org/apache/crimson/parser/Parser2.error(Parser2.java:3343)
   at
org/apache/crimson/parser/ValidatingParser$ChildrenValidator.done(ValidatingParser.java:361)
   at

org/apache/crimson/parser/Parser2.maybeElement(Parser2.java:1692)
 
I have the following configuration files
 
 http://www.ibatis.com/dtd/sql-map-config-2.dtd";>

 
  

 
 And my PODataAS400.xml is as below

 
 http://www.ibatis.com/dtd/sql-map-2.dtd";>
 

 
 
 I have not defined any SQL, is it not legal to do
 so
 
 Ashish


A$HI$H



__ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs


can we create databean on fly

2005-10-25 Thread Ashish Kulkarni
Hi
Suppose if i want to get any data using ibatis, this
is what i do
1, Create a javabean to store this data
public class MyBean
{
 private String a;
 //get and set methods
}
2, define in xml file SQL statement 

Select name from nametable


Now if i have to change the SQL statement i have to go
and change the bean, this is okay if there is some
slight modification, but if there is really a big
change in SQL statement then it is really a pain to
change the bean
Is there a way we can create this bean on the fly,
like DynaBean in struts,

Ashish



__ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com


Re: best method to get SqlMapClient in web application

2005-10-25 Thread Ashish Kulkarni
Alan
What you are doing is singleton pattern, it makes sure
that there is only one instance of SqlMapClient
through out your application.

Ashish



--- Alan Chandler <[EMAIL PROTECTED]> wrote:

> On Monday 24 Oct 2005 16:50, Ashish Kulkarni wrote:
> > Hello
> > What is the best way to get SqlMapClient in a web
> > application
> > 1 , Define a singleton pattern class, and create a
> > instance of SqlMapClient to use by all classes
> which
> > need to access data.
> >
> > 2, Define a AbstractClass and put method to get
> > SqlMapClient in constructor of this class, and
> then
> > each class which needs to get data extends this
> class
> >
> >
> > 3, Create Instance of SqlMapClient in one of the
> init
> > servlets, and store this SqlMapClient in
> > ServletContext and pass it as one of the
> parameters to
> > all data classes
> >
> > 4, or any other method
> 
> I have been following this thread without really
> understanding it.  
> 
> I would be interested in any comments on what I do,
> which I think is point 1 
> (but I am new to Java and I am not sure I understand
> what a singleton is 
> properly).  In particular, I am not sure I
> understand what the potential 
> Gotcha's are.  Why doesn't everybody do it this way,
> it seems so SIMPLE.
> 
> The reason I do this is that I am attempting to
> avoid creating a session to 
> early in my application - but this has not been
> commented on in the thread at 
> all.
> 
> This is my basic class:
> 
> package uk.org.chandlerfamily.sqlmap.famtree;
> 
> import com.ibatis.common.resources.Resources;
> import com.ibatis.sqlmap.client.*;
> import java.io.Reader;
> 
> public class FamtreeMap {
>   private static final SqlMapClient sqlMap;
>   static {
> try {
> String resource = 
>
"uk/org/chandlerfamily/sqlmap/famtree/SqlMapConfig.xml";
> Reader reader = Resources.getResourceAsReader
> (resource);
> sqlMap =
> SqlMapClientBuilder.buildSqlMapClient(reader);
>  } catch (Exception e) {
> e.printStackTrace();
> throw new RuntimeException ("Error
> initializing DataMap class. Cause: " 
> + e);
>  }
>   }
>   public static SqlMapClient getSqlMapInstance () {
> return sqlMap;
>   }
> 
> }
> 
> 
> 
> and then whenever I want to do something with my
> database I do
> 
>   SqlMapClient map=FamtreeMap.getSqlMapInstance();
>   try {
>   map.startTransaction();
> ...
> ...
> 
> -- 
> Alan Chandler
> http://www.chandlerfamily.org.uk
> Open Source. It's the difference between trust and
> antitrust.
> 




__ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com


Re: best method to get SqlMapClient in web application

2005-10-24 Thread Ashish Kulkarni
Jeff
Suppose if i have a following class 
GetData, which has following code
sqlMapClient.delete("deleteCOExternal",coDataBean);

This GetData class is being called by a servlet, then
this servlet has to get sqlMapClient from servlet
context and pass it to GetData class, 
this way we are tying GetData with servlet, If i have
to call GetData without using servlet then i will have
to design my own ServletContext type of setup.

Have you ever tried to user singleton pattern to get
sqlMapClient, 
and then in GetData class do 
GetMySqlMap.getInstance().getSqlMap()
This way we dont have class GetData depend on servlet.

Ashish



--- Jeff Butler <[EMAIL PROTECTED]> wrote:

> Here's a listener:
>  package somepackage;
> 
> import javax.servlet.ServletContextEvent;
> import javax.servlet.ServletContextListener;
> 
> public class ContextListener implements
> ServletContextListener {
> 
> public ContextListener() {
> super();
> }
>  public void contextInitialized(ServletContextEvent
> sce) {
>  // generate your client through normal methods
>  SqlMapClient client = createSqlMapClient();
> 
>
sce.getServletContext().setAttribute(SqlMapClient.class.getName(),
>  client);
> }
>   public void contextDestroyed(ServletContextEvent
> sce) {
> }
> }
>  Then you need to write a method somewhere like
> this:
>  public SqlMapClient getSqlMapClient(ServletContext
> context) {
>  return (SqlMapClient)
>  context.getAttribute(SqlMapClient.class.getName());
> }
>  You also need to configure the listener in web.xml.
> Pretty simple...
>  Jeff Butler
> 
>  On 10/24/05, Ashish Kulkarni
> <[EMAIL PROTECTED]> wrote:
> >
> > Jeff
> > Can you provide me a sample code of putting
> > SqlMapClient in servlet context with listener and
> > access it from class which requires to access it
> >
> > Ashish
> >
> > --- Jeff Butler <[EMAIL PROTECTED]> wrote:
> >
> > > I don't know if it's the best or not, but I
> often
> > > times put the SqlMapClient
> > > into the servlet context with a listener. I
> think
> > > this is essentially what
> > > Spring does too.
> > > Jeff Butler
> > >
> > > On 10/24/05, Ashish Kulkarni
> > > <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Hello
> > > > What is the best way to get SqlMapClient in a
> web
> > > > application
> > > > 1 , Define a singleton pattern class, and
> create a
> > > > instance of SqlMapClient to use by all classes
> > > which
> > > > need to access data.
> > > >
> > > > 2, Define a AbstractClass and put method to
> get
> > > > SqlMapClient in constructor of this class, and
> > > then
> > > > each class which needs to get data extends
> this
> > > class
> > > >
> > > >
> > > > 3, Create Instance of SqlMapClient in one of
> the
> > > init
> > > > servlets, and store this SqlMapClient in
> > > > ServletContext and pass it as one of the
> > > parameters to
> > > > all data classes
> > > >
> > > > 4, or any other method
> > > >
> > > > Ashish
> > > >
> > > >
> > > >
> > > >
> > > > __
> > > > Yahoo! Mail - PC Magazine Editors' Choice 2005
> > > > http://mail.yahoo.com
> > > >
> > >
> >
> >
> >
> >
> > __
> > Start your day with Yahoo! - Make it your home
> page!
> > http://www.yahoo.com/r/hs
> >
> 





__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


Re: best method to get SqlMapClient in web application

2005-10-24 Thread Ashish Kulkarni
Jeff
Can you provide me a sample code of putting
SqlMapClient in servlet context with listener and
access it from class which requires to access it

Ashish

--- Jeff Butler <[EMAIL PROTECTED]> wrote:

> I don't know if it's the best or not, but I often
> times put the SqlMapClient
> into the servlet context with a listener. I think
> this is essentially what
> Spring does too.
>  Jeff Butler
> 
>  On 10/24/05, Ashish Kulkarni
> <[EMAIL PROTECTED]> wrote:
> >
> > Hello
> > What is the best way to get SqlMapClient in a web
> > application
> > 1 , Define a singleton pattern class, and create a
> > instance of SqlMapClient to use by all classes
> which
> > need to access data.
> >
> > 2, Define a AbstractClass and put method to get
> > SqlMapClient in constructor of this class, and
> then
> > each class which needs to get data extends this
> class
> >
> >
> > 3, Create Instance of SqlMapClient in one of the
> init
> > servlets, and store this SqlMapClient in
> > ServletContext and pass it as one of the
> parameters to
> > all data classes
> >
> > 4, or any other method
> >
> > Ashish
> >
> >
> >
> >
> > __
> > Yahoo! Mail - PC Magazine Editors' Choice 2005
> > http://mail.yahoo.com
> >
> 




__ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs


best method to get SqlMapClient in web application

2005-10-24 Thread Ashish Kulkarni
Hello
What is the best way to get SqlMapClient in a web
application
1 , Define a singleton pattern class, and create a
instance of SqlMapClient to use by all classes which
need to access data.

2, Define a AbstractClass and put method to get
SqlMapClient in constructor of this class, and then
each class which needs to get data extends this class


3, Create Instance of SqlMapClient in one of the init
servlets, and store this SqlMapClient in
ServletContext and pass it as one of the parameters to
all data classes

4, or any other method

Ashish




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


Re: XML document output from ibatis

2005-09-13 Thread Ashish Kulkarni
Parshanth
do you have a code/example of such DAO 

--- Prashanth Sukumaran <[EMAIL PROTECTED]>
wrote:

> Hi Ashish,
>  
> Cool this is fine.  But the idea of a RowHandler is
> to have such conversions out of the DAO.  Also it
> looks clean as if IBatis is returning the Document
> object.  
>  
> The work of the DAO layer is to only execute queries
> and return the data.  You can externalize such
> transformations into the RowHandler.  
>  
> Rgds
> Prashanth Sukumaran.
> 
> Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> Hi
> this is a way i got around my problem
> // definiation in xml file
> 
>
parameterClass="java.math.BigDecimal"xmlResultName="PO">//
> SQL querry goes herre
> // to get a list of all data from ibatis
> 
> List list = client.queryForList("getdata", new
> BigDecimal("12345"));
> // go through the list
> for (int i = 0; i < list.size(); i++)
> {
> String obj = (String) list.get(i);
> // get byte array input stream from string 
> ByteArrayInputStream byteArray = new
> ByteArrayInputStream(obj.getBytes());
> // create DMO object 
> Document doc =
> factory.newDocumentBuilder().parse(byteArray);
> }
> 
> 
> Ashish
> 
> 
> --- Larry Meadors wrote:
> 
> > Wit apologies to Clinton, my official opinion on
> > iBATIS XML results is
> > that they suck.
> > 
> > If you want to do what you are describing, do it
> in
> > your DAO class. If
> > you want multiple records, do it with a
> RowHandler.
> > 
> > Larry
> > 
> > 
> > On 9/12/05, Ashish Kulkarni
> > wrote:
> > > Hi
> > > Is it possible to get XML document from ibatis
> > > I am trying to get a XML document as a
> resultClass
> > > from ibatis, here is what i am doing
> > > > > parameterClass="java.math.BigDecimal"> >
> xmlResultName="PO" >> > SELECT A.PCPORD AS PCPORD> >
> from Pu1012> > WHERE A.Pcpord = #value#> >
> > > String str =
> > > (String)client.queryForObject("getPOData",
> poNum);
> > > 
> > > I cannot define resultClass =
> > "org.w3c.dom.Document"
> > > 
> > > Is it possible to do so
> > > 
> > > Ashish
> > > 
> > >
> __
> > > Do You Yahoo!?
> > > Tired of spam? Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.com
> > >
> > 
> 
> 
> __
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 


A$HI$H



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


Re: XML document output from ibatis

2005-09-13 Thread Ashish Kulkarni
Hi
this is a way i got around my problem
// definiation in xml file

// SQL querry goes herre

// to get a list of all data from ibatis

  List list = client.queryForList("getdata", new
BigDecimal("12345"));
// go through the list
 for (int i = 0; i < list.size(); i++)
   {
   String obj = (String) list.get(i);
// get byte array input stream from string 
 ByteArrayInputStream byteArray = new
ByteArrayInputStream(obj.getBytes());
// create DMO object 
 Document doc =
factory.newDocumentBuilder().parse(byteArray);
   }


Ashish


--- Larry Meadors <[EMAIL PROTECTED]> wrote:

> Wit apologies to Clinton, my official opinion on
> iBATIS XML results is
> that they suck.
> 
> If you want to do what you are describing, do it in
> your DAO class. If
> you want multiple records, do it with a RowHandler.
> 
> Larry
> 
> 
> On 9/12/05, Ashish Kulkarni
> <[EMAIL PROTECTED]> wrote:
> > Hi
> > Is it possible to get XML document from ibatis
> > I am trying to get a XML document as a resultClass
> > from ibatis, here is what i am doing
> >  > parameterClass="java.math.BigDecimal"
> > xmlResultName="PO" >
> > SELECT  A.PCPORD  AS PCPORD
> > from Pu1012
> > WHERE A.Pcpord  = #value#
> > 
> > String str =
> > (String)client.queryForObject("getPOData", poNum);
> > 
> > I cannot define resultClass =
> "org.w3c.dom.Document"
> > 
> > Is it possible to do so
> > 
> > Ashish
> > 
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


XML document output from ibatis

2005-09-12 Thread Ashish Kulkarni
Hi
Is it possible to get XML document from ibatis 
I am trying to get a XML document as a resultClass
from ibatis, here is what i am doing

SELECT  A.PCPORD  AS PCPORD
from Pu1012
WHERE A.Pcpord  = #value# 

String str =
(String)client.queryForObject("getPOData", poNum);

I cannot define resultClass = "org.w3c.dom.Document"

Is it possible to do so

Ashish

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Database connection

2005-09-01 Thread Ashish Kulkarni
Hello
Is there a way to use existing database connection
with ibatis?
I have a java program in which i create a connection
and want to include ibatis to do some data extraction,
do i have to specify connection in properties file, or
is there a way i can use the same connection created
in this application

Ashish




Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


Re: [OT]SQL question

2005-07-14 Thread Ashish Kulkarni
Hello
this is what i tried

select * from test1 where
substring(type1,1,1) < '0' and
substring(type1,2,1)< '0'

i think it works

--- Larry Meadors <[EMAIL PROTECTED]> wrote:

> Brute force?
> 
> select * from test1 
> where type1 not like '%1%'
>   and type1 not like '%2%'
>   and type1 not like '%3%'
>   and type1 not like '%4%'
>   and type1 not like '%5%'
>   and type1 not like '%6%'
>   and type1 not like '%7%'
>   and type1 not like '%8%'
>   and type1 not like '%9%'
>   and type1 not like '%0%'
> 
> Crude, but effective...
> 
> Larry
> 
> 
> On 7/13/05, Ashish Kulkarni
> <[EMAIL PROTECTED]> wrote:
> > Hello
> > I have a table called test1 in DB2 database, in
> this
> > table there is column name type1 which is 2 char
> in
> > lenght,
> > I want to write a SQL statement where i want to
> select
> > all the records where "type1 does not have any
> numeric
> > data"
> > for example
> > if following is data in type1 column
> > AB
> > CA
> > AA
> > 12
> > 23
> > A3
> > 
> > then this sql statment must select only AB, CA and
> AA
> > and ignore 12,23,A3 because there is a numeric
> data in
> > any field
> > 
> > Ashish
> > 
> > 
> > 
> > 
> > 
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> 


A$HI$H




Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


[OT]SQL question

2005-07-13 Thread Ashish Kulkarni
Hello
I have a table called test1 in DB2 database, in this
table there is column name type1 which is 2 char in
lenght,
I want to write a SQL statement where i want to select
all the records where "type1 does not have any numeric
data"
for example
if following is data in type1 column
AB
CA
AA
12
23
A3

then this sql statment must select only AB, CA and AA
and ignore 12,23,A3 because there is a numeric data in
any field

Ashish





__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: problem with delete statement definition , SQL0206 error

2005-07-12 Thread Ashish Kulkarni
Zarar
Do you have an example for trying to do what i am
doing without using a parameter MAP


 DELETE FROM POCOMMENT WHERE SYSTEM=#system# and
 USER=#user# and ENVNAME=#envname# and
 P204PORD = #ponum# and P204ROUT=#routing#


Ashish
--- Zarar Siddiqi <[EMAIL PROTECTED]> wrote:

> You haven't posted the calling code so it's tough to
> see what might be 
> wrong.  But I have a hunch that this might have to
> do with "SYSTEM" being a 
> reserved keyword so you might have to escape it with
> back ticks.  Thats just 
> a shot in the dark.  Also, as far as I can see, just
> passing in a Map of 
> Integer and String objects should work fine and you
> don't really need to use 
> a parameter map.
> 
> 
> - Original Message - 
> From: "Ashish Kulkarni" <[EMAIL PROTECTED]>
> To: 
> Sent: Tuesday, July 12, 2005 1:59 PM
> Subject: problem with delete statement definition ,
> SQL0206 error
> 
> 
> > Hello
> > I am getting the following error
> > Check the  DELETE FROM POCOMMENT WHERE
> SYSTEM=#system#
> > and USER=#user# and ENVNAME=#envname# and P204PORD
> =
> > #ponum# and P204ROUT=#routing# .
> > --- Check the SQL Statement (preparation failed).
> > --- Cause: java.sql.SQLException: [SQL0206] Column
> > #SYSTEM# not in specified tables.
> >
> > Why do i get it,
> >
> > Here is what i have defined in my xml file
> > 
> >  > javaType="java.lang.String" />
> >  > javaType="java.lang.String" />
> >  > javaType="java.lang.String" />
> >  > javaType="java.math.BigDecimal" />
> >  > javaType="java.lang.String" />
> > 
> >
> >  >parameterMap="po-map-param">
> > DELETE FROM POCOMMENT WHERE SYSTEM=#system# and
> > USER=#user# and ENVNAME=#envname# and
> > P204PORD = #ponum# and P204ROUT=#routing#
> > 
> >
> > I am
> >
> >
> >
> >
> > __
> > Yahoo! Mail
> > Stay connected, organized, and protected. Take the
> tour:
> > http://tour.mail.yahoo.com/mailtour.html
> >
> > 
> 
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


problem with delete statement definition , SQL0206 error

2005-07-12 Thread Ashish Kulkarni
Hello
I am getting the following error
Check the  DELETE FROM POCOMMENT WHERE SYSTEM=#system#
and USER=#user# and ENVNAME=#envname# and P204PORD =
#ponum# and P204ROUT=#routing#  .  
--- Check the SQL Statement (preparation failed).  
--- Cause: java.sql.SQLException: [SQL0206] Column
#SYSTEM# not in specified tables.

Why do i get it, 

Here is what i have defined in my xml file

 







 DELETE FROM POCOMMENT WHERE SYSTEM=#system# and
 USER=#user# and ENVNAME=#envname# and 
 P204PORD = #ponum# and P204ROUT=#routing#


I am 




__ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 



how to define multiple input parameters in select statement

2005-07-11 Thread Ashish Kulkarni
Hello
If my sql statement is "select * from abc where a = ?"
then i define in my xml file as below

  SELECT * from abc where a = #value#>

In my java program i do
List list  = sqlMap.queryForList("getPOData",
bigDecimal);

Q1 If i have multiple parameters in select statement
how do i define, 
for example my sql statement will be 
select * from abc where a =? and b =? and c=?

Ashish


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: Caused by: com.ibatis.sqlmap.client.SqlMapException: Unrecognized parameter mapping field

2005-07-05 Thread Ashish Kulkarni
Hi
Thanks, it worked, i am using DB2 on AS400 as database
for this query

Ashish

--- Larry Meadors <[EMAIL PROTECTED]> wrote:

> Any fields with # in them need to be escaped with ##
> 
> A.PCVER# AS PCVER,
> 
>  - should be - 
> 
> A.PCVER## AS PCVER,
> 
> 
> ..and...
> 
>WHERE A.Pcpord  = "VALUE#
> 
>  - should be - 
> 
>WHERE A.Pcpord  = #VALUE#
> 
> What db is this? That is a freaky looking join with
> all the
> (((( in there.
> 
> Larry
> 
> 
> On 7/5/05, Ashish Kulkarni
> <[EMAIL PROTECTED]> wrote:
> > Hi
> > I am not sure why i am getting the above error, is
> > there a way to debug it.
> > I am going to paste my xml file definiation here,
> > I am sure this SQL statement works
> > the error i am getting is as below
> > Caused by:
> com.ibatis.sqlmap.client.SqlMapException:
> > Unrecognized parameter mapping field: ' F.P813NAME
> AS
> > P813NAME' in  AS BP2FAX, F.P813NAME AS P813NAME,
> > F.P813PHON AS P813PHON, G.P830DESC AS P830DESC,
> > A.PCSHPV AS PCSHPV, A.PCFRGT AS PCFRGT, A.PCORIG
> AS
> > PCORIG, A.PCCURR AS PCCURR, A.PCEXCG AS PCEXCG,
> > A.PCBUYR AS PCBUYR, A.PCBLOR AS PCBLOR, A.PCSRCE
> AS
> > PCSRCE, A.PCVALU AS PCVALU, A.PCAKDT AS PCAKDT,
> > A.PCVNDT AS PCVNDT, A.PCFXDT AS PCFXDT, A.PCINDT
> AS
> > PCINDT, A.PCSPN1 AS PCSPN1, A.PCSPN2 AS PCSPN2,
> > A.PCSPN3 AS PCSPN3, A.PCENDU AS PCENDU, A.PCUSF1
> AS
> > PCUSF1, A.PCUSF2 AS PCUSF2, A.PCUSF3 AS PCUSF3,
> > A.PCSTAT AS PCSTAT, A.PCCANC AS PCCANC, A.PCVER
> > 
> > 
> > my sql statement is as below
> > 
> > SELECT  A.PCPORD  AS PCPORD  ,
> > A.PCVALU  AS PCVALU ,
> > A.PCPTYP  AS PCPTYP ,
> > A.PCODAT  AS PCODAT  ,
> > A.PCVNDR  AS PCVNDR  ,
> > A.PCINVV AS PCINVV,
> > A.PCSHPT AS PCSHPT,
> > A.PCBILT AS PCBILT,
> > A.PCCONF AS PCCONF,
> > A.PCROUT AS PCROUT,
> > A.PCASTA AS PCASTA,
> > A.PCAPVU AS PCAPVU,
> > A.PCAPVD AS PCAPVD,
> > A.PCAPVT AS PCAPVT,
> > A.PCPAYT AS PCPAYT,
> > A.PCDISC AS PCDISC,
> > C.P2FAX# AS BP2FAX,
> > F.P813NAME AS P813NAME,
> > F.P813PHON AS P813PHON,
> > G.P830DESC AS P830DESC,
> > A.PCSHPV AS PCSHPV,
> > A.PCFRGT AS PCFRGT,
> > A.PCORIG AS PCORIG,
> > A.PCCURR AS PCCURR,
> > A.PCEXCG AS PCEXCG,
> > A.PCBUYR AS PCBUYR,
> > A.PCBLOR AS PCBLOR,
> > A.PCSRCE AS PCSRCE,
> > A.PCVALU AS PCVALU,
> > A.PCAKDT AS PCAKDT,
> > A.PCVNDT AS PCVNDT,
> > A.PCFXDT AS PCFXDT,
> > A.PCINDT AS PCINDT,
> > A.PCSPN1 AS PCSPN1,
> > A.PCSPN2 AS PCSPN2,
> > A.PCSPN3 AS PCSPN3,
> > A.PCENDU AS PCENDU,
> > A.PCUSF1 AS PCUSF1,
> > A.PCUSF2 AS PCUSF2,
> > A.PCUSF3 AS PCUSF3,
> > A.PCSTAT AS PCSTAT,
> > A.PCCANC AS PCCANC,
> > A.PCVER# AS PCVER,
> > A.PCINCO AS PCINCO,
> >  A.PCDATE AS PCDATE,
> >  A.PCTIME AS PCTIME,
> >  A.PCUSER AS PCUSER,
> >  H.P1NAME  AS VP1NAME  ,
> >  H.P1ADR1  AS VP1ADR1 ,
> >  H.P1ADR2  AS VP1ADR2 ,
> >  H.P1ADR3  AS VP1ADR3 ,
> >  H.P1COUN  AS VP1COUN ,
> >  H.P1PROV  AS VP1PROV ,
> >  H.P1CITY  AS VP1CITY ,
> >  H.P1STE   AS VP1STE  ,
> >  H.P1CTRY  AS VP1CTRY ,
> >  H.P1ZIP   AS VP1ZIP  ,
> >  H.P1TEL#  AS VP1TEL  ,
> >  H.P1FAX#  AS VP1FAX  ,
> >  H.P1MAIL  AS VP1MAIL ,
> >  H.P1CONT  AS VP1CONT ,
> >  A.PCSHPT  AS PCSHPT,
> >  B.P2NAME  AS SNAME,
> >  B.P2ADR1 AS SP2ADR1,
> > B.P2ADR2 AS SP2ADR2,
> > B.P2CITY AS SP2CITY,
> > B.P2STE  AS SP2STE ,
> > B.P2ZIP  AS SP2ZIP ,
> > B.P2ATTN AS SP2ATTN,
> > B.P2PHON AS SP2PHON,
> > B.P2FAX# AS SP2FAX,
> > C.P2NAME  AS BNAME,
> > C.P2ADR1 AS BP2ADR1,
> > C.P2ADR2 AS BP2ADR2,
> > C.P2CITY AS BP2CITY,
> > C.P2STE  AS BP2STE ,
> > C.P2ZIP  AS BP2ZIP ,
> > C.P2ATTN AS BP2ATTN,
> > C.P2PHON AS BP2PHON,
> > D.P832DESC AS P832DESC,
> > E.P834DESC AS P834DESC,
> > J.PDLINE  AS PDLINE ,
> > J.PDITEM  AS PDITEM ,
> > K.M0DESC   AS M0DESC ,
> > J.PDPUME  AS PDPUME ,
> > J.PDREQ   AS PDREQ  ,
> > J.PDRQRD  AS PDRQRD ,
> > J.PDRQST  AS PDRQST,
> > J.PDSETP  AS PDSETP ,
> > J.PDQTYP  AS PDQTYP ,
> > J.PDPRCE  AS PDPRCE,
> > I.SENAME   AS SENAME,
> > L.C803CNAM AS C803NAM,
> > L.C803GSDS  AS C803GSDS,
> > M.P804DESC  AS P804DESC,
> > N.P039PORD  AS P039

Caused by: com.ibatis.sqlmap.client.SqlMapException: Unrecognized parameter mapping field

2005-07-05 Thread Ashish Kulkarni
Hi
I am not sure why i am getting the above error, is
there a way to debug it.
I am going to paste my xml file definiation here, 
I am sure this SQL statement works 
the error i am getting is as below
Caused by: com.ibatis.sqlmap.client.SqlMapException:
Unrecognized parameter mapping field: ' F.P813NAME AS
P813NAME' in  AS BP2FAX, F.P813NAME AS P813NAME,
F.P813PHON AS P813PHON, G.P830DESC AS P830DESC,
A.PCSHPV AS PCSHPV, A.PCFRGT AS PCFRGT, A.PCORIG AS
PCORIG, A.PCCURR AS PCCURR, A.PCEXCG AS PCEXCG,
A.PCBUYR AS PCBUYR, A.PCBLOR AS PCBLOR, A.PCSRCE AS
PCSRCE, A.PCVALU AS PCVALU, A.PCAKDT AS PCAKDT,
A.PCVNDT AS PCVNDT, A.PCFXDT AS PCFXDT, A.PCINDT AS
PCINDT, A.PCSPN1 AS PCSPN1, A.PCSPN2 AS PCSPN2,
A.PCSPN3 AS PCSPN3, A.PCENDU AS PCENDU, A.PCUSF1 AS
PCUSF1, A.PCUSF2 AS PCUSF2, A.PCUSF3 AS PCUSF3,
A.PCSTAT AS PCSTAT, A.PCCANC AS PCCANC, A.PCVER


my sql statement is as below

SELECT  A.PCPORD  AS PCPORD  ,  
A.PCVALU  AS PCVALU ,   
A.PCPTYP  AS PCPTYP ,   
A.PCODAT  AS PCODAT  ,  
A.PCVNDR  AS PCVNDR  ,  
A.PCINVV AS PCINVV, 
A.PCSHPT AS PCSHPT, 
A.PCBILT AS PCBILT, 
A.PCCONF AS PCCONF, 
A.PCROUT AS PCROUT, 
A.PCASTA AS PCASTA, 
A.PCAPVU AS PCAPVU, 
A.PCAPVD AS PCAPVD, 
A.PCAPVT AS PCAPVT, 
A.PCPAYT AS PCPAYT, 
A.PCDISC AS PCDISC,  
C.P2FAX# AS BP2FAX,  
F.P813NAME AS P813NAME,  
F.P813PHON AS P813PHON,  
G.P830DESC AS P830DESC, 
A.PCSHPV AS PCSHPV, 
A.PCFRGT AS PCFRGT, 
A.PCORIG AS PCORIG, 
A.PCCURR AS PCCURR, 
A.PCEXCG AS PCEXCG,
A.PCBUYR AS PCBUYR,
A.PCBLOR AS PCBLOR,
A.PCSRCE AS PCSRCE,
A.PCVALU AS PCVALU,
A.PCAKDT AS PCAKDT,
A.PCVNDT AS PCVNDT,
A.PCFXDT AS PCFXDT,
A.PCINDT AS PCINDT,
A.PCSPN1 AS PCSPN1,
A.PCSPN2 AS PCSPN2,
A.PCSPN3 AS PCSPN3,
A.PCENDU AS PCENDU,
A.PCUSF1 AS PCUSF1,
A.PCUSF2 AS PCUSF2,
A.PCUSF3 AS PCUSF3,
A.PCSTAT AS PCSTAT,
A.PCCANC AS PCCANC,
A.PCVER# AS PCVER, 
A.PCINCO AS PCINCO,
 A.PCDATE AS PCDATE, 
 A.PCTIME AS PCTIME, 
 A.PCUSER AS PCUSER, 
 H.P1NAME  AS VP1NAME  , 
 H.P1ADR1  AS VP1ADR1 ,  
 H.P1ADR2  AS VP1ADR2 ,  
 H.P1ADR3  AS VP1ADR3 ,  
 H.P1COUN  AS VP1COUN ,  
 H.P1PROV  AS VP1PROV ,  
 H.P1CITY  AS VP1CITY ,  
 H.P1STE   AS VP1STE  ,  
 H.P1CTRY  AS VP1CTRY ,  
 H.P1ZIP   AS VP1ZIP  ,  
 H.P1TEL#  AS VP1TEL  ,  
 H.P1FAX#  AS VP1FAX  ,  
 H.P1MAIL  AS VP1MAIL ,  
 H.P1CONT  AS VP1CONT ,  
 A.PCSHPT  AS PCSHPT,
 B.P2NAME  AS SNAME, 
 B.P2ADR1 AS SP2ADR1,
B.P2ADR2 AS SP2ADR2, 
B.P2CITY AS SP2CITY, 
B.P2STE  AS SP2STE , 
B.P2ZIP  AS SP2ZIP , 
B.P2ATTN AS SP2ATTN, 
B.P2PHON AS SP2PHON, 
B.P2FAX# AS SP2FAX,  
C.P2NAME  AS BNAME,  
C.P2ADR1 AS BP2ADR1, 
C.P2ADR2 AS BP2ADR2, 
C.P2CITY AS BP2CITY, 
C.P2STE  AS BP2STE , 
C.P2ZIP  AS BP2ZIP , 
C.P2ATTN AS BP2ATTN, 
C.P2PHON AS BP2PHON,  
D.P832DESC AS P832DESC,
E.P834DESC AS P834DESC,
J.PDLINE  AS PDLINE , 
J.PDITEM  AS PDITEM , 
K.M0DESC   AS M0DESC ,
J.PDPUME  AS PDPUME , 
J.PDREQ   AS PDREQ  , 
J.PDRQRD  AS PDRQRD , 
J.PDRQST  AS PDRQST,  
J.PDSETP  AS PDSETP , 
J.PDQTYP  AS PDQTYP , 
J.PDPRCE  AS PDPRCE,  
I.SENAME   AS SENAME, 
L.C803CNAM AS C803NAM,
L.C803GSDS  AS C803GSDS,  
M.P804DESC  AS P804DESC,  
N.P039PORD  AS P039PORD,   
N.P039POLN  AS P039POLN,   
N.P039DSLN  AS P039DSLN,   
N.P039QTY   AS P039QTY ,   
N.P039SHIP  AS P039SHIP,   
N.P039DELV  AS P039DELV,   
N.P039REQ   AS P039REQ ,   
N.P039COMM  AS P039COMM,   
P.P2NAME  AS PBNAME,   
P.P2ADR1 AS PBP2ADR1,  
P.P2ADR2 AS PBP2ADR2,  
P.P2CITY AS PBP2CITY,  
P.P2STE  AS PBP2STE ,  
P.P2ZIP  AS PBP2ZIP ,  
P.P2ATTN AS PBP2ATTN,  
P.P2PHON AS PBP2PHON,  
P.P2FAX# AS PBP2FAX,   
Q.P2NAME  AS QBNAME,   
Q.P2ADR1 AS QBP2ADR1,  
Q.P2ADR2 AS QBP2ADR2,  
 Q.P2CITY AS QBP2CITY,   
 Q.P2STE  AS QBP2STE ,   
 Q.P2ZIP  AS QBP2ZIP ,   
 Q.P2ATTN AS QBP2ATTN,   
 Q.P2PHON AS QBP2PHON,   
 Q.P2FAX# AS QBP2FAX,
 R.SENAME AS RSENAME,
S.SENAME AS SSENAME 
   FROM   
   
  
   
  Pu1012 A left join pu1002 B on  
   
   A.PcShpt = B.P2code )   Left join Pu1002 C
on  
   A.PcBilt = C.P2code )   Left Join Pu1832 D
on  
   A.PcShpv = D.P832Code ) Left join Pu1834 E
on  
   A.PcFRGT = E.P834Code ) Left join PU1813 F
on  
   A.PCBUYR = F.P813Code)  Left join PU1830 G
on  
   A.PCPAYT = G.P830Code)  Left join PU1001 H
on  
   A.PCVNDR = H.P1VNDR)Left join SE1001 I
on 
   A.PCAPVU = I.SEUSID)Left join CF1803C L
on
   A.PCCOMP = L.C803COMP)  Left join PU1804 M
on 
   A.PCpt

Re: There is no READABLE property named error

2005-07-01 Thread Ashish Kulkarni
Hello
I think the problem is because code in my bean is as
below
private java.lang.String P813NAME ;
public void setP813NAME (java.lang.String P813NAME )
{
this.P813NAME = P813NAME;
}
public java.lang.String getP813NAME ()
{
return this.P813NAME ;
}

does this comply to java bean standards

Ashish



--- Ashish Kulkarni <[EMAIL PROTECTED]>
wrote:

> Hi
> I am trying to use SQL Map to insert data into
> database,
> this table has 124 columns, and i have defined a
> java
> bean to map with this database,
> I am sure that the database bean and insert statment
> in xml file is correct, 
> but still i get this error, is there a way to debug
> and find what is going wrong,
> is there a limitation to number of columns to be
> inserted in table.
> How do i debug this problem
> 
> 
> Ashish
> 
> 
>   
> 
> 
> Yahoo! Sports 
> Rekindle the Rivalries. Sign up for Fantasy Football
> 
> http://football.fantasysports.yahoo.com
> 


A$HI$H



 
Yahoo! Sports 
Rekindle the Rivalries. Sign up for Fantasy Football 
http://football.fantasysports.yahoo.com


  1   2   >