You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by IBATIS <ve...@wipro.com> on 2007/10/19 13:22:23 UTC

Please help - Using IBatis in RAD 7.0

Hi There,

I am facing issues while I invoke a sql / stored procedure in RAD 7.0 using
Ibatis.

Do I need add any .jars or others to make it work with RAD.

Please look into the issues as below.

1. while I invoke a plain sql I am not getting the result.
2. While I invoke a stored procedure, the transaction is getting timed out.

when i invoke the above using ordinary java.sql.connection ( I get this
connection object from SqlMapClient.getDataSource().getConnection()) it is
working fine for both points 1&2.

Your help will be highly appreciated. 

Regards
Venkat
-- 
View this message in context: http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13292529
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Please help - Using IBatis in RAD 7.0

Posted by IBATIS <ve...@wipro.com>.
Hi Larry,

Thanks for the response.

Let me tell you my Stored Procedure approach.


1.Parameter Map set in one of my ibatis resource .xml file is as below. 

 <parameterMap class="BagTagVO" id="bagTagSPParam">

<parameter property="BAGID" jdbcType="VARCHAR" mode="IN" />

<parameter property="APCDE" jdbcType="VARCHAR" mode="IN" />

<parameter property="CRTNDTM" jdbcType="VARCHAR" mode="IN" />

<parameter property="BAGDATA" jdbcType="VARCHAR" mode="OUT" />

<parameter property="RETURNCODE" jdbcType="INTEGER" mode="OUT" />

</parameterMap>


below is the stored procedure calling portion.

<procedure id="retrieveBagTagInfoSP" parameterMap="bagTagSPParam">

{call Bag_Information.BagTag_Inquiry(?,?,?,?,?) }

</procedure>

Using the above while I invoke the stored procedure. My application hangs
and after say 120 mins I got a timed out exception. i increased the timeout
limit to 400 even then I am unable to execute the stored procedure. 

When I try to invoke the same stored procedure through normal
java.sql.connection and callable statement it gives me result within 2 secs.

I changed my .xml parameter map to HashMap and also I tried replacing the
'?' as #param1...." and invoked it even then it was throwing error.


Your help in this regard would be highly appreciated.




Larry Meadors-2 wrote:
> 
> I know both work, but without seeing any code...it's impossible for us
> to see what your specific issue is.
> 
> Larry
> 
> 
> On 10/19/07, IBATIS <ve...@wipro.com> wrote:
>>
>> Hi There,
>>
>> I am facing issues while I invoke a sql / stored procedure in RAD 7.0
>> using
>> Ibatis.
>>
>> Do I need add any .jars or others to make it work with RAD.
>>
>> Please look into the issues as below.
>>
>> 1. while I invoke a plain sql I am not getting the result.
>> 2. While I invoke a stored procedure, the transaction is getting timed
>> out.
>>
>> when i invoke the above using ordinary java.sql.connection ( I get this
>> connection object from SqlMapClient.getDataSource().getConnection()) it
>> is
>> working fine for both points 1&2.
>>
>> Your help will be highly appreciated.
>>
>> Regards
>> Venkat
>> --
>> View this message in context:
>> http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13292529
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13294463
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Unable to log sql queries in my log files

Posted by IBATIS <ve...@wipro.com>.
Hi Chetan,

It is working now. Thanks for your valuable suggesstion. The mistake was,
since I had the two jar files reference
(Ibatis-2.3.0.677.jar,Ibatis-sqlmap-2.jar), I was not able to get the
method(selectLog...) now I am having the reference of Ibatis-2.3.0.677.jar
alone and it is solved now.

Regards
Venkat


Chetan Nayak wrote:
> 
> Try using this line before you make calls to IBATIS API,
>  LogFactory.selectLog4jLoggin() ,I'm just guessing here.
> 
> Thanks
> Chetan
> 
> 
> 
> On 1/9/08, IBATIS <ve...@wipro.com> wrote:
>>
>>
>> Hi There,
>>
>> I am unable to log my sql queries used in ibatis sql mapper. Let me
>> narrate
>> the steps I used.
>>
>> I have put the following entries into my log4j.properties file.
>> log4j.logger.com.ibatis=DEBUG,ibatisFile
>> log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG,ibatisFile
>> log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG,ibatisFile
>>
>> log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientImpl=DEBUG
>> ,ibatisFile
>> log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG
>> ,ibatisFile
>> log4j.logger.java.sql.Connection=DEBUG,ibatisFile
>> log4j.logger.java.sql.Statement=DEBUG,ibatisFile
>> log4j.logger.java.sql.PreparedStatement=DEBUG,ibatisFile
>> log4j.logger.java.sql.ResultSet=DEBUG,ibatisFile
>>
>> log4j.appender.ibatisFile=org.apache.log4j.RollingFileAppender
>> log4j.appender.ibatisFile.MaxFileSize=6MB
>> log4j.appender.ibatisFile.immediateFlush=true
>> log4j.appender.ibatisFile.MaxBackupIndex=3
>> log4j.appender.ibatisFile.File=/logs/MyIBatis.log
>> log4j.appender.ibatisFile.Threshold=DEBUG
>> log4j.appender.ibatisFile.append=true
>> log4j.appender.ibatisFile.layout=org.apache.log4j.PatternLayout
>> log4j.appender.ibatisFile.layout.ConversionPattern=%d{yyyy/MM/dd
>> HH:mm:ss,SSS}: <%p> %m%n
>>
>> I have put my log4j.property file under ejbModule (I am using RAD 7.0 and
>> this folder would be created when we are creating an ejb project). I have
>> my
>> log entries in the same log files which is working fine.
>> I am unable to see the sql queries in 'MyIBatis.log'. The file
>> 'MyIBatis.log' is getting generated but there are no sql entries into it.
>>
>> Please help me out. Tell me where I am doing wrong.
>>
>> Thanks
>> Venkat
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tp13292529p14695875.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tp13292529p14700183.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Unable to log sql queries in my log files

Posted by IBATIS <ve...@wipro.com>.
Hi Chetan,

I would like to correct my previous message. 

I am not getting the selectLog4jLogging method from my LogFactory class. I
am currently using the following APIs. Please let me know if I need to
remove or replace someother Jar file.

Currently Used API are
Ibatis-2.3.0.677.jar
Ibatis-common-2.jar
Ibatis-sqlmap-2.jar
commons-logging.jar
log4j-1.2.13.jar

I believe that I need to instantiate the LogFactory class which is found
under com.ibatis.common.logging right?

Thanks
Venkat


Chetan Nayak wrote:
> 
> Try using this line before you make calls to IBATIS API,
>  LogFactory.selectLog4jLoggin() ,I'm just guessing here.
> 
> Thanks
> Chetan
> 
> 
> 
> On 1/9/08, IBATIS  wrote:
>>
>>
>> Hi There,
>>
>> I am unable to log my sql queries used in ibatis sql mapper. Let me
>> narrate
>> the steps I used.
>>
>> I have put the following entries into my log4j.properties file.
>> log4j.logger.com.ibatis=DEBUG,ibatisFile
>> log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG,ibatisFile
>> log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG,ibatisFile
>>
>> log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientImpl=DEBUG
>> ,ibatisFile
>> log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG
>> ,ibatisFile
>> log4j.logger.java.sql.Connection=DEBUG,ibatisFile
>> log4j.logger.java.sql.Statement=DEBUG,ibatisFile
>> log4j.logger.java.sql.PreparedStatement=DEBUG,ibatisFile
>> log4j.logger.java.sql.ResultSet=DEBUG,ibatisFile
>>
>> log4j.appender.ibatisFile=org.apache.log4j.RollingFileAppender
>> log4j.appender.ibatisFile.MaxFileSize=6MB
>> log4j.appender.ibatisFile.immediateFlush=true
>> log4j.appender.ibatisFile.MaxBackupIndex=3
>> log4j.appender.ibatisFile.File=/logs/MyIBatis.log
>> log4j.appender.ibatisFile.Threshold=DEBUG
>> log4j.appender.ibatisFile.append=true
>> log4j.appender.ibatisFile.layout=org.apache.log4j.PatternLayout
>> log4j.appender.ibatisFile.layout.ConversionPattern=%d{yyyy/MM/dd
>> HH:mm:ss,SSS}: <%p> %m%n
>>
>> I have put my log4j.property file under ejbModule (I am using RAD 7.0 and
>> this folder would be created when we are creating an ejb project). I have
>> my
>> log entries in the same log files which is working fine.
>> I am unable to see the sql queries in 'MyIBatis.log'. The file
>> 'MyIBatis.log' is getting generated but there are no sql entries into it.
>>
>> Please help me out. Tell me where I am doing wrong.
>>
>> Thanks
>> Venkat
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tp13292529p14695875.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tp13292529p14698230.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

Re: Unable to log sql queries in my log files

Posted by IBATIS <ve...@wipro.com>.
Hi Chetan,

Thanks for the information. I am instantiating my sqlmapclient only once.
Hence do I need to put this piece of code before I get the instance for the
first time. Also could you please be more specific on the code because I am
unable to put the LogFactory.selectLog4j... method.

Thanks
Venkat



Chetan Nayak wrote:
> 
> Try using this line before you make calls to IBATIS API,
>  LogFactory.selectLog4jLoggin() ,I'm just guessing here.
> 
> Thanks
> Chetan
> 
> 
> 
> On 1/9/08, IBATIS <ve...@wipro.com> wrote:
>>
>>
>> Hi There,
>>
>> I am unable to log my sql queries used in ibatis sql mapper. Let me
>> narrate
>> the steps I used.
>>
>> I have put the following entries into my log4j.properties file.
>> log4j.logger.com.ibatis=DEBUG,ibatisFile
>> log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG,ibatisFile
>> log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG,ibatisFile
>>
>> log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientImpl=DEBUG
>> ,ibatisFile
>> log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG
>> ,ibatisFile
>> log4j.logger.java.sql.Connection=DEBUG,ibatisFile
>> log4j.logger.java.sql.Statement=DEBUG,ibatisFile
>> log4j.logger.java.sql.PreparedStatement=DEBUG,ibatisFile
>> log4j.logger.java.sql.ResultSet=DEBUG,ibatisFile
>>
>> log4j.appender.ibatisFile=org.apache.log4j.RollingFileAppender
>> log4j.appender.ibatisFile.MaxFileSize=6MB
>> log4j.appender.ibatisFile.immediateFlush=true
>> log4j.appender.ibatisFile.MaxBackupIndex=3
>> log4j.appender.ibatisFile.File=/logs/MyIBatis.log
>> log4j.appender.ibatisFile.Threshold=DEBUG
>> log4j.appender.ibatisFile.append=true
>> log4j.appender.ibatisFile.layout=org.apache.log4j.PatternLayout
>> log4j.appender.ibatisFile.layout.ConversionPattern=%d{yyyy/MM/dd
>> HH:mm:ss,SSS}: <%p> %m%n
>>
>> I have put my log4j.property file under ejbModule (I am using RAD 7.0 and
>> this folder would be created when we are creating an ejb project). I have
>> my
>> log entries in the same log files which is working fine.
>> I am unable to see the sql queries in 'MyIBatis.log'. The file
>> 'MyIBatis.log' is getting generated but there are no sql entries into it.
>>
>> Please help me out. Tell me where I am doing wrong.
>>
>> Thanks
>> Venkat
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tp13292529p14695875.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tp13292529p14696957.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Unable to log sql queries in my log files

Posted by Chetan Nayak <ch...@gmail.com>.
Try using this line before you make calls to IBATIS API,
 LogFactory.selectLog4jLoggin() ,I'm just guessing here.

Thanks
Chetan



On 1/9/08, IBATIS <ve...@wipro.com> wrote:
>
>
> Hi There,
>
> I am unable to log my sql queries used in ibatis sql mapper. Let me
> narrate
> the steps I used.
>
> I have put the following entries into my log4j.properties file.
> log4j.logger.com.ibatis=DEBUG,ibatisFile
> log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG,ibatisFile
> log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG,ibatisFile
>
> log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientImpl=DEBUG
> ,ibatisFile
> log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG
> ,ibatisFile
> log4j.logger.java.sql.Connection=DEBUG,ibatisFile
> log4j.logger.java.sql.Statement=DEBUG,ibatisFile
> log4j.logger.java.sql.PreparedStatement=DEBUG,ibatisFile
> log4j.logger.java.sql.ResultSet=DEBUG,ibatisFile
>
> log4j.appender.ibatisFile=org.apache.log4j.RollingFileAppender
> log4j.appender.ibatisFile.MaxFileSize=6MB
> log4j.appender.ibatisFile.immediateFlush=true
> log4j.appender.ibatisFile.MaxBackupIndex=3
> log4j.appender.ibatisFile.File=/logs/MyIBatis.log
> log4j.appender.ibatisFile.Threshold=DEBUG
> log4j.appender.ibatisFile.append=true
> log4j.appender.ibatisFile.layout=org.apache.log4j.PatternLayout
> log4j.appender.ibatisFile.layout.ConversionPattern=%d{yyyy/MM/dd
> HH:mm:ss,SSS}: <%p> %m%n
>
> I have put my log4j.property file under ejbModule (I am using RAD 7.0 and
> this folder would be created when we are creating an ejb project). I have
> my
> log entries in the same log files which is working fine.
> I am unable to see the sql queries in 'MyIBatis.log'. The file
> 'MyIBatis.log' is getting generated but there are no sql entries into it.
>
> Please help me out. Tell me where I am doing wrong.
>
> Thanks
> Venkat
>
> --
> View this message in context:
> http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tp13292529p14695875.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Unable to log sql queries in my log files

Posted by IBATIS <ve...@wipro.com>.
Hi There,

I am unable to log my sql queries used in ibatis sql mapper. Let me narrate
the steps I used.

I have put the following entries into my log4j.properties file.
log4j.logger.com.ibatis=DEBUG,ibatisFile
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG,ibatisFile
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG,ibatisFile

log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientImpl=DEBUG,ibatisFile
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG,ibatisFile
log4j.logger.java.sql.Connection=DEBUG,ibatisFile
log4j.logger.java.sql.Statement=DEBUG,ibatisFile
log4j.logger.java.sql.PreparedStatement=DEBUG,ibatisFile
log4j.logger.java.sql.ResultSet=DEBUG,ibatisFile

log4j.appender.ibatisFile=org.apache.log4j.RollingFileAppender
log4j.appender.ibatisFile.MaxFileSize=6MB
log4j.appender.ibatisFile.immediateFlush=true
log4j.appender.ibatisFile.MaxBackupIndex=3
log4j.appender.ibatisFile.File=/logs/MyIBatis.log
log4j.appender.ibatisFile.Threshold=DEBUG
log4j.appender.ibatisFile.append=true
log4j.appender.ibatisFile.layout=org.apache.log4j.PatternLayout
log4j.appender.ibatisFile.layout.ConversionPattern=%d{yyyy/MM/dd
HH:mm:ss,SSS}: <%p> %m%n

I have put my log4j.property file under ejbModule (I am using RAD 7.0 and
this folder would be created when we are creating an ejb project). I have my
log entries in the same log files which is working fine. 
I am unable to see the sql queries in 'MyIBatis.log'. The file
'MyIBatis.log' is getting generated but there are no sql entries into it.

Please help me out. Tell me where I am doing wrong. 

Thanks
Venkat

-- 
View this message in context: http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tp13292529p14695875.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Please help - Using IBatis in RAD 7.0

Posted by IBATIS <ve...@wipro.com>.
Hello my dear friend,

First of all thanks a lot for your reply. I got that solved by using a
update instead of queryforObject as you said. I am using the sqlmapper
approach only even earlier.

One question, in case my procedure is returning a resultset will this update
statement holds good for that too? Is it something like we need to call only
update in case of stored procedures. Why queryForObject is failing.

Regards
Venkat



Abhigyan Agrawal1 wrote:
> 
> Hi Venkat,
> 1. You can refer to the dtd which is put locally. That is definitely not 
> the problem.
> 2. As you have stated, you are using the jar files from jpetstore. This 
> and the fact that your program is able to find all the classes and methods 
> leads me to safely rule out any jar problem. (Otherwise you won't find the 
> method itself instead of timeout).
> 3. The transactionManager description is correct. I don't think you need 
> to add any more thing.
>         I am not able to throw more light on the issue as I am not able to 
> replicate the problem. However, you may want to try and make an instance 
> of sqlMapper yourself (instead of DAO) and  then call the procedure. i.e., 
> something like below -
>  
>         SqlMapClient sqlMapper;
>         Reader reader = null;
>                 try {
>                         reader = Resources
>                                         .getResourceAsReader("
> com/nwa/safetrac/domain/common/dao/sqlmap/SqlMapConfig.xml");
>                 } catch (IOException e1) {
>                         e1.printStackTrace();
>                 }
> 
>                 sqlMapper = SqlMapClientBuilder.buildSqlMapClient(reader);
>                 sqlMapper.queryForObject("retrieveBagTagInfoSP", 
> hshBagTag); 
> 
> and you may also want to try update method as well. iBATIS also makes 
> callable statement, so you should debug the last statement and see what 
> happens.
> I am sure debugging would help as this is clearly not a problem with 
> synatax. 
> 
> Cheers,
> Abhigyan Agrawal
> 
> 
> 
> 
> IBATIS <ve...@wipro.com> 
> 23/10/2007 15:18
> Please respond to
> user-java@ibatis.apache.org
> 
> 
> To
> user-java@ibatis.apache.org
> cc
> 
> Subject
> Re: Please help - Using IBatis in RAD 7.0
> 
> 
> 
> 
> 
> 
> 
> Hi Abhigyan,
> 
> Thank you very much for your detailed response. Even now there is no luck
> for me. I am using the IBatis for the first time. I am calling my DAO from 
> a
> stateless session bean of Container managed persistence. This DAO uses
> SQLMapper to call the stored procedure.
> 
> And I am not using any timeout explicitly. Also please note that when I
> invoke the same SP from an ordinary Java Programme with CallableStatement,
> it is getting executed. 
> 
> For more detail please see the below sqlmapconfig.xml entry as below.
> 
> <!DOCTYPE sqlMapConfig 
>     PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" 
>     "sql-map-config-2.dtd"> (I copied sql-map-config-2.dtd from the 
> website
> and referring it locally. Is this how we need to do? )
> 
> <sqlMapConfig>
> 
>                  <properties
>  
> resource="com/nwa/safetrac/domain/common/dao/sqlmap/SqlMapConfig.properties"
> />
>                  <!-- 
>                 <transactionManager type="JDBC">
>                 <dataSource type="JNDI">
>                 <property name="DataSource" 
> value="jdbc/SafetracDatasource" /> 
>                 </dataSource> 
>                 </transactionManager>
>         -->
> 
> 
> Is there anything wrong with the below transaction manager description. Do 
> I
> need to add / modify anything additionally.
>                  <transactionManager type="JDBC">
>                                  <dataSource type="SIMPLE">
>                                                  <property 
> name="JDBC.Driver" value="${driver}" />
>                                                  <property 
> name="JDBC.ConnectionURL" value="${url}" />
>                                                  <property 
> name="JDBC.Username" value="${username}" />
>                                                  <property 
> name="JDBC.Password" value="${password}" />
>                                  </dataSource>
>                  </transactionManager>
> 
>                  <sqlMap 
> resource="com/nwa/safetrac/domain/common/dao/sql/Bags.xml" />
> 
> </sqlMapConfig>
> 
> Abhigyan : - It would be of great help if you could find out the problem. 
> if
> you could find some clue and based on the above or if the information is 
> not
> enough please let me know. I shall send you the required things.
> 
> Could you please check whether the .jar files what I am using is the 
> correct
> one or I need to use something else?
> 
> Thanks
> Venkat
> 
> 
> Abhigyan Agrawal1 wrote:
>> 
>> Hi Venkat,
>>         The first error you are getting is definitely because of wrong 
>> jdbc type. 
>> I tried the code you have given and it gives the same error (register 
>> output parameters failed) until I change it to VARCHAR instead of 
>> VARCHAR2. After doing the change, the code is running through iBATIS 
>> displaying expected results.  Which database are you using? 
>>         One more thing, you can remove resultClass from procedure as you 
> 
>> are already giving parameterClass of the same map.
>>         As far as the transaction is getting timed out is concerned, are 
> 
>> you providing some timeout values yourself? because I am not and the 
>> procedure is executing without problem.
>> 
>> Cheers,
>> Abhigyan Agrawal 
>> 
>> 
>> 
>> 
>> IBATIS <ve...@wipro.com> 
>> 20/10/2007 16:45
>> Please respond to
>> user-java@ibatis.apache.org
>> 
>> 
>> To
>> user-java@ibatis.apache.org
>> cc
>> 
>> Subject
>> Re: Please help - Using IBatis in RAD 7.0
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Larry,
>> 
>> Sorry for not being clear with my queries. I have refined my query as 
>> below.
>> Please help me out.
>> 
>> I have a stored procedure as below.
>> 
>> CREATE OR REPLACE procedure mytest
>>                  (
>>                  In_Bag_ID      in     varchar,
>>                  In_Station     in     varchar,
>>                  In_Crtn_Dtm    in     varchar,
>>                  Out_Bag_Data          out varchar2,
>>                  Out_Return_Cde        out number)
>> is
>> Begin
>>                  Out_Bag_Data := 'success';
>>                  Out_Return_Cde := 0;
>> End mytest;
>> /
>> 
>> 
>> My .xml resource file entry is as below
>> 
>>                  <procedure id="retrieveBagTagInfoSP" 
>> parameterClass="java.util.HashMap"
>> resultClass="java.util.HashMap">
>>                  {call mytest 
>> (#bagid,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
>> #apcde,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
>> #crtndtm,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
>> #bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#,
>> #returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#)}
>>                  </procedure>
>> 
>> My Calling java programme is as below.
>> 
>> hshBagTag.put("bagid","");
>> hshBagTag.put("apcde","");
>> hshBagTag.put("crtndtm","");
>> hshBagTag.put("bagdata",new String(""));
>> hshBagTag.put("returncode", new Integer(0)); 
>> 
>> SqlMapperClient.queryForObject("retrieveBagTagInfoSP", 
>> hshBagTag,hshBagTag);
>> 
>> While I invoke the stored procedure, I am getting the following error
>> 
>> --- The error occurred in 
> com/nwa/safetrac/domain/common/dao/sql/Bags.xml. 
>> 
>> --- The error occurred while executing query procedure. 
>> --- Check the {call mytest (?, ?, ?, ?, ?)}. 
>> --- Check the output parameters (register output parameters failed). 
>> --- Cause: java.sql.SQLException: Invalid column type
>> 
>> 
>> In the same above I changed the 
>> 
>> #bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#, 
>> to
>> #bagdata,javaType=java.lang.String,jdbcType=VARCHAR,mode=OUT#, 
>> 
>> and
>> #returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#
>> to
>> #returncode,javaType=java.lang.Double,jdbcType=DECIMAL,mode=OUT#)
>> 
>> Now, the above error was not occurring but the transaction is getting 
>> timed
>> out. 
>> 
>> Could you please tell me where I am going wrong,  I am badly in need of 
> a
>> help.
>> 
>> My Environment is as below.
>> 
>> Development Environment  -  RAD 7.0 (Websphere Application server 6.0)
>> Ibatis jar files - ibatis-common-2.jar / ibatis-sqlmap-2.jar (i got it 
>> from
>> jpetstore example package)
>> 
>> Regards
>> Venkat
>> 
>> 
>> Larry Meadors-2 wrote:
>>> 
>>> I know both work, but without seeing any code...it's impossible for us
>>> to see what your specific issue is.
>>> 
>>> Larry
>>> 
>>> 
>>> On 10/19/07, IBATIS <ve...@wipro.com> wrote:
>>>>
>>>> Hi There,
>>>>
>>>> I am facing issues while I invoke a sql / stored procedure in RAD 7.0
>>>> using
>>>> Ibatis.
>>>>
>>>> Do I need add any .jars or others to make it work with RAD.
>>>>
>>>> Please look into the issues as below.
>>>>
>>>> 1. while I invoke a plain sql I am not getting the result.
>>>> 2. While I invoke a stored procedure, the transaction is getting timed
>>>> out.
>>>>
>>>> when i invoke the above using ordinary java.sql.connection ( I get 
> this
>>>> connection object from SqlMapClient.getDataSource().getConnection()) 
> it
>>>> is
>>>> working fine for both points 1&2.
>>>>
>>>> Your help will be highly appreciated.
>>>>
>>>> Regards
>>>> Venkat
>>>> --
>>>> View this message in context:
>>>> 
>> 
> http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13292529
> 
>> 
>>>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>>>
>>>>
>>> 
>>> 
>> 
>> -- 
>> View this message in context: 
>> 
> http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13308959
> 
>> 
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>> 
>> 
>> 
>> 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13360597
> 
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13362318
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Please help - Using IBatis in RAD 7.0

Posted by Abhigyan Agrawal1 <ab...@in.ibm.com>.
Hi Venkat,
1. You can refer to the dtd which is put locally. That is definitely not 
the problem.
2. As you have stated, you are using the jar files from jpetstore. This 
and the fact that your program is able to find all the classes and methods 
leads me to safely rule out any jar problem. (Otherwise you won't find the 
method itself instead of timeout).
3. The transactionManager description is correct. I don't think you need 
to add any more thing.
        I am not able to throw more light on the issue as I am not able to 
replicate the problem. However, you may want to try and make an instance 
of sqlMapper yourself (instead of DAO) and  then call the procedure. i.e., 
something like below -
 
        SqlMapClient sqlMapper;
        Reader reader = null;
                try {
                        reader = Resources
                                        .getResourceAsReader("
com/nwa/safetrac/domain/common/dao/sqlmap/SqlMapConfig.xml");
                } catch (IOException e1) {
                        e1.printStackTrace();
                }

                sqlMapper = SqlMapClientBuilder.buildSqlMapClient(reader);
                sqlMapper.queryForObject("retrieveBagTagInfoSP", 
hshBagTag); 

and you may also want to try update method as well. iBATIS also makes 
callable statement, so you should debug the last statement and see what 
happens.
I am sure debugging would help as this is clearly not a problem with 
synatax. 

Cheers,
Abhigyan Agrawal




IBATIS <ve...@wipro.com> 
23/10/2007 15:18
Please respond to
user-java@ibatis.apache.org


To
user-java@ibatis.apache.org
cc

Subject
Re: Please help - Using IBatis in RAD 7.0







Hi Abhigyan,

Thank you very much for your detailed response. Even now there is no luck
for me. I am using the IBatis for the first time. I am calling my DAO from 
a
stateless session bean of Container managed persistence. This DAO uses
SQLMapper to call the stored procedure.

And I am not using any timeout explicitly. Also please note that when I
invoke the same SP from an ordinary Java Programme with CallableStatement,
it is getting executed. 

For more detail please see the below sqlmapconfig.xml entry as below.

<!DOCTYPE sqlMapConfig 
    PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" 
    "sql-map-config-2.dtd"> (I copied sql-map-config-2.dtd from the 
website
and referring it locally. Is this how we need to do? )

<sqlMapConfig>

                 <properties
 
resource="com/nwa/safetrac/domain/common/dao/sqlmap/SqlMapConfig.properties"
/>
                 <!-- 
                <transactionManager type="JDBC">
                <dataSource type="JNDI">
                <property name="DataSource" 
value="jdbc/SafetracDatasource" /> 
                </dataSource> 
                </transactionManager>
        -->


Is there anything wrong with the below transaction manager description. Do 
I
need to add / modify anything additionally.
                 <transactionManager type="JDBC">
                                 <dataSource type="SIMPLE">
                                                 <property 
name="JDBC.Driver" value="${driver}" />
                                                 <property 
name="JDBC.ConnectionURL" value="${url}" />
                                                 <property 
name="JDBC.Username" value="${username}" />
                                                 <property 
name="JDBC.Password" value="${password}" />
                                 </dataSource>
                 </transactionManager>

                 <sqlMap 
resource="com/nwa/safetrac/domain/common/dao/sql/Bags.xml" />

</sqlMapConfig>

Abhigyan : - It would be of great help if you could find out the problem. 
if
you could find some clue and based on the above or if the information is 
not
enough please let me know. I shall send you the required things.

Could you please check whether the .jar files what I am using is the 
correct
one or I need to use something else?

Thanks
Venkat


Abhigyan Agrawal1 wrote:
> 
> Hi Venkat,
>         The first error you are getting is definitely because of wrong 
> jdbc type. 
> I tried the code you have given and it gives the same error (register 
> output parameters failed) until I change it to VARCHAR instead of 
> VARCHAR2. After doing the change, the code is running through iBATIS 
> displaying expected results.  Which database are you using? 
>         One more thing, you can remove resultClass from procedure as you 

> are already giving parameterClass of the same map.
>         As far as the transaction is getting timed out is concerned, are 

> you providing some timeout values yourself? because I am not and the 
> procedure is executing without problem.
> 
> Cheers,
> Abhigyan Agrawal 
> 
> 
> 
> 
> IBATIS <ve...@wipro.com> 
> 20/10/2007 16:45
> Please respond to
> user-java@ibatis.apache.org
> 
> 
> To
> user-java@ibatis.apache.org
> cc
> 
> Subject
> Re: Please help - Using IBatis in RAD 7.0
> 
> 
> 
> 
> 
> 
> 
> Larry,
> 
> Sorry for not being clear with my queries. I have refined my query as 
> below.
> Please help me out.
> 
> I have a stored procedure as below.
> 
> CREATE OR REPLACE procedure mytest
>                  (
>                  In_Bag_ID      in     varchar,
>                  In_Station     in     varchar,
>                  In_Crtn_Dtm    in     varchar,
>                  Out_Bag_Data          out varchar2,
>                  Out_Return_Cde        out number)
> is
> Begin
>                  Out_Bag_Data := 'success';
>                  Out_Return_Cde := 0;
> End mytest;
> /
> 
> 
> My .xml resource file entry is as below
> 
>                  <procedure id="retrieveBagTagInfoSP" 
> parameterClass="java.util.HashMap"
> resultClass="java.util.HashMap">
>                  {call mytest 
> (#bagid,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
> #apcde,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
> #crtndtm,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
> #bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#,
> #returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#)}
>                  </procedure>
> 
> My Calling java programme is as below.
> 
> hshBagTag.put("bagid","");
> hshBagTag.put("apcde","");
> hshBagTag.put("crtndtm","");
> hshBagTag.put("bagdata",new String(""));
> hshBagTag.put("returncode", new Integer(0)); 
> 
> SqlMapperClient.queryForObject("retrieveBagTagInfoSP", 
> hshBagTag,hshBagTag);
> 
> While I invoke the stored procedure, I am getting the following error
> 
> --- The error occurred in 
com/nwa/safetrac/domain/common/dao/sql/Bags.xml. 
> 
> --- The error occurred while executing query procedure. 
> --- Check the {call mytest (?, ?, ?, ?, ?)}. 
> --- Check the output parameters (register output parameters failed). 
> --- Cause: java.sql.SQLException: Invalid column type
> 
> 
> In the same above I changed the 
> 
> #bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#, 
> to
> #bagdata,javaType=java.lang.String,jdbcType=VARCHAR,mode=OUT#, 
> 
> and
> #returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#
> to
> #returncode,javaType=java.lang.Double,jdbcType=DECIMAL,mode=OUT#)
> 
> Now, the above error was not occurring but the transaction is getting 
> timed
> out. 
> 
> Could you please tell me where I am going wrong,  I am badly in need of 
a
> help.
> 
> My Environment is as below.
> 
> Development Environment  -  RAD 7.0 (Websphere Application server 6.0)
> Ibatis jar files - ibatis-common-2.jar / ibatis-sqlmap-2.jar (i got it 
> from
> jpetstore example package)
> 
> Regards
> Venkat
> 
> 
> Larry Meadors-2 wrote:
>> 
>> I know both work, but without seeing any code...it's impossible for us
>> to see what your specific issue is.
>> 
>> Larry
>> 
>> 
>> On 10/19/07, IBATIS <ve...@wipro.com> wrote:
>>>
>>> Hi There,
>>>
>>> I am facing issues while I invoke a sql / stored procedure in RAD 7.0
>>> using
>>> Ibatis.
>>>
>>> Do I need add any .jars or others to make it work with RAD.
>>>
>>> Please look into the issues as below.
>>>
>>> 1. while I invoke a plain sql I am not getting the result.
>>> 2. While I invoke a stored procedure, the transaction is getting timed
>>> out.
>>>
>>> when i invoke the above using ordinary java.sql.connection ( I get 
this
>>> connection object from SqlMapClient.getDataSource().getConnection()) 
it
>>> is
>>> working fine for both points 1&2.
>>>
>>> Your help will be highly appreciated.
>>>
>>> Regards
>>> Venkat
>>> --
>>> View this message in context:
>>> 
> 
http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13292529

> 
>>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
> 
> -- 
> View this message in context: 
> 
http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13308959

> 
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13360597

Sent from the iBATIS - User - Java mailing list archive at Nabble.com.



Re: Please help - Using IBatis in RAD 7.0

Posted by IBATIS <ve...@wipro.com>.
Hi Abhigyan,

Thank you very much for your detailed response. Even now there is no luck
for me. I am using the IBatis for the first time. I am calling my DAO from a
stateless session bean of Container managed persistence. This DAO uses
SQLMapper to call the stored procedure.

And I am not using any timeout explicitly. Also please note that when I
invoke the same SP from an ordinary Java Programme with CallableStatement,
it is getting executed. 

For more detail please see the below sqlmapconfig.xml entry as below.

<!DOCTYPE sqlMapConfig      
    PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"      
    "sql-map-config-2.dtd"> (I copied sql-map-config-2.dtd from the website
and referring it locally. Is this how we need to do? )

<sqlMapConfig>

	<properties
	
resource="com/nwa/safetrac/domain/common/dao/sqlmap/SqlMapConfig.properties"
/>
	<!-- 
		<transactionManager type="JDBC">
		<dataSource type="JNDI">
		<property name="DataSource" value="jdbc/SafetracDatasource" />			
		</dataSource>		
		</transactionManager>
	-->


Is there anything wrong with the below transaction manager description. Do I
need to add / modify anything additionally.
	<transactionManager type="JDBC">
		<dataSource type="SIMPLE">
			<property name="JDBC.Driver" value="${driver}" />
			<property name="JDBC.ConnectionURL" value="${url}" />
			<property name="JDBC.Username" value="${username}" />
			<property name="JDBC.Password" value="${password}" />
		</dataSource>
	</transactionManager>

	<sqlMap resource="com/nwa/safetrac/domain/common/dao/sql/Bags.xml" />

</sqlMapConfig>

Abhigyan : - It would be of great help if you could find out the problem. if
you could find some clue and based on the above or if the information is not
enough please let me know. I shall send you the required things.

Could you please check whether the .jar files what I am using is the correct
one or I need to use something else?

Thanks
Venkat


Abhigyan Agrawal1 wrote:
> 
> Hi Venkat,
>         The first error you are getting is definitely because of wrong 
> jdbc type. 
> I tried the code you have given and it gives the same error (register 
> output parameters failed) until I change it to VARCHAR instead of 
> VARCHAR2. After doing the change, the code is running through iBATIS 
> displaying expected results.  Which database are you using? 
>         One more thing, you can remove resultClass from procedure as you 
> are already giving parameterClass of the same map.
>         As far as the transaction is getting timed out is concerned, are 
> you providing some timeout values yourself? because I am not and the 
> procedure is executing without problem.
>  
> Cheers,
> Abhigyan Agrawal 
> 
> 
> 
> 
> IBATIS <ve...@wipro.com> 
> 20/10/2007 16:45
> Please respond to
> user-java@ibatis.apache.org
> 
> 
> To
> user-java@ibatis.apache.org
> cc
> 
> Subject
> Re: Please help - Using IBatis in RAD 7.0
> 
> 
> 
> 
> 
> 
> 
> Larry,
> 
> Sorry for not being clear with my queries. I have refined my query as 
> below.
> Please help me out.
> 
> I have a stored procedure as below.
> 
> CREATE OR REPLACE procedure mytest
>                  (
>                  In_Bag_ID      in     varchar,
>                  In_Station     in     varchar,
>                  In_Crtn_Dtm    in     varchar,
>                  Out_Bag_Data          out varchar2,
>                  Out_Return_Cde        out number)
> is
> Begin
>                  Out_Bag_Data := 'success';
>                  Out_Return_Cde := 0;
> End mytest;
> /
> 
> 
> My .xml resource file entry is as below
> 
>                  <procedure id="retrieveBagTagInfoSP" 
> parameterClass="java.util.HashMap"
> resultClass="java.util.HashMap">
>                  {call mytest 
> (#bagid,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
> #apcde,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
> #crtndtm,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
> #bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#,
> #returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#)}
>                  </procedure>
> 
> My Calling java programme is as below.
> 
> hshBagTag.put("bagid","");
> hshBagTag.put("apcde","");
> hshBagTag.put("crtndtm","");
> hshBagTag.put("bagdata",new String(""));
> hshBagTag.put("returncode", new Integer(0));  
> 
> SqlMapperClient.queryForObject("retrieveBagTagInfoSP", 
> hshBagTag,hshBagTag);
> 
> While I invoke the stored procedure, I am getting the following error
> 
> --- The error occurred in com/nwa/safetrac/domain/common/dao/sql/Bags.xml. 
>  
> --- The error occurred while executing query procedure. 
> --- Check the {call mytest (?, ?, ?, ?, ?)}. 
> --- Check the output parameters (register output parameters failed). 
> --- Cause: java.sql.SQLException: Invalid column type
> 
> 
> In the same above I changed the 
> 
> #bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#, 
> to
> #bagdata,javaType=java.lang.String,jdbcType=VARCHAR,mode=OUT#, 
> 
> and
> #returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#
> to
> #returncode,javaType=java.lang.Double,jdbcType=DECIMAL,mode=OUT#)
> 
> Now, the above error was not occurring but the transaction is getting 
> timed
> out. 
> 
> Could you please tell me where I am going wrong,  I am badly in need of a
> help.
> 
> My Environment is as below.
> 
> Development Environment  -  RAD 7.0 (Websphere Application server 6.0)
> Ibatis jar files - ibatis-common-2.jar / ibatis-sqlmap-2.jar (i got it 
> from
> jpetstore example package)
> 
> Regards
> Venkat
> 
> 
> Larry Meadors-2 wrote:
>> 
>> I know both work, but without seeing any code...it's impossible for us
>> to see what your specific issue is.
>> 
>> Larry
>> 
>> 
>> On 10/19/07, IBATIS <ve...@wipro.com> wrote:
>>>
>>> Hi There,
>>>
>>> I am facing issues while I invoke a sql / stored procedure in RAD 7.0
>>> using
>>> Ibatis.
>>>
>>> Do I need add any .jars or others to make it work with RAD.
>>>
>>> Please look into the issues as below.
>>>
>>> 1. while I invoke a plain sql I am not getting the result.
>>> 2. While I invoke a stored procedure, the transaction is getting timed
>>> out.
>>>
>>> when i invoke the above using ordinary java.sql.connection ( I get this
>>> connection object from SqlMapClient.getDataSource().getConnection()) it
>>> is
>>> working fine for both points 1&2.
>>>
>>> Your help will be highly appreciated.
>>>
>>> Regards
>>> Venkat
>>> --
>>> View this message in context:
>>> 
> http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13292529
> 
>>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13308959
> 
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13360597
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Please help - Using IBatis in RAD 7.0

Posted by IBATIS <ve...@wipro.com>.
Hi Abhigyan,

I forgot to mention about the databas. It is Oracle 10G.

Regards
Venkat


Abhigyan Agrawal1 wrote:
> 
> Hi Venkat,
>         The first error you are getting is definitely because of wrong 
> jdbc type. 
> I tried the code you have given and it gives the same error (register 
> output parameters failed) until I change it to VARCHAR instead of 
> VARCHAR2. After doing the change, the code is running through iBATIS 
> displaying expected results.  Which database are you using? 
>         One more thing, you can remove resultClass from procedure as you 
> are already giving parameterClass of the same map.
>         As far as the transaction is getting timed out is concerned, are 
> you providing some timeout values yourself? because I am not and the 
> procedure is executing without problem.
>  
> Cheers,
> Abhigyan Agrawal 
> 
> 
> 
> 
> IBATIS <ve...@wipro.com> 
> 20/10/2007 16:45
> Please respond to
> user-java@ibatis.apache.org
> 
> 
> To
> user-java@ibatis.apache.org
> cc
> 
> Subject
> Re: Please help - Using IBatis in RAD 7.0
> 
> 
> 
> 
> 
> 
> 
> Larry,
> 
> Sorry for not being clear with my queries. I have refined my query as 
> below.
> Please help me out.
> 
> I have a stored procedure as below.
> 
> CREATE OR REPLACE procedure mytest
>                  (
>                  In_Bag_ID      in     varchar,
>                  In_Station     in     varchar,
>                  In_Crtn_Dtm    in     varchar,
>                  Out_Bag_Data          out varchar2,
>                  Out_Return_Cde        out number)
> is
> Begin
>                  Out_Bag_Data := 'success';
>                  Out_Return_Cde := 0;
> End mytest;
> /
> 
> 
> My .xml resource file entry is as below
> 
>                  <procedure id="retrieveBagTagInfoSP" 
> parameterClass="java.util.HashMap"
> resultClass="java.util.HashMap">
>                  {call mytest 
> (#bagid,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
> #apcde,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
> #crtndtm,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
> #bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#,
> #returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#)}
>                  </procedure>
> 
> My Calling java programme is as below.
> 
> hshBagTag.put("bagid","");
> hshBagTag.put("apcde","");
> hshBagTag.put("crtndtm","");
> hshBagTag.put("bagdata",new String(""));
> hshBagTag.put("returncode", new Integer(0));  
> 
> SqlMapperClient.queryForObject("retrieveBagTagInfoSP", 
> hshBagTag,hshBagTag);
> 
> While I invoke the stored procedure, I am getting the following error
> 
> --- The error occurred in com/nwa/safetrac/domain/common/dao/sql/Bags.xml. 
>  
> --- The error occurred while executing query procedure. 
> --- Check the {call mytest (?, ?, ?, ?, ?)}. 
> --- Check the output parameters (register output parameters failed). 
> --- Cause: java.sql.SQLException: Invalid column type
> 
> 
> In the same above I changed the 
> 
> #bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#, 
> to
> #bagdata,javaType=java.lang.String,jdbcType=VARCHAR,mode=OUT#, 
> 
> and
> #returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#
> to
> #returncode,javaType=java.lang.Double,jdbcType=DECIMAL,mode=OUT#)
> 
> Now, the above error was not occurring but the transaction is getting 
> timed
> out. 
> 
> Could you please tell me where I am going wrong,  I am badly in need of a
> help.
> 
> My Environment is as below.
> 
> Development Environment  -  RAD 7.0 (Websphere Application server 6.0)
> Ibatis jar files - ibatis-common-2.jar / ibatis-sqlmap-2.jar (i got it 
> from
> jpetstore example package)
> 
> Regards
> Venkat
> 
> 
> Larry Meadors-2 wrote:
>> 
>> I know both work, but without seeing any code...it's impossible for us
>> to see what your specific issue is.
>> 
>> Larry
>> 
>> 
>> On 10/19/07, IBATIS <ve...@wipro.com> wrote:
>>>
>>> Hi There,
>>>
>>> I am facing issues while I invoke a sql / stored procedure in RAD 7.0
>>> using
>>> Ibatis.
>>>
>>> Do I need add any .jars or others to make it work with RAD.
>>>
>>> Please look into the issues as below.
>>>
>>> 1. while I invoke a plain sql I am not getting the result.
>>> 2. While I invoke a stored procedure, the transaction is getting timed
>>> out.
>>>
>>> when i invoke the above using ordinary java.sql.connection ( I get this
>>> connection object from SqlMapClient.getDataSource().getConnection()) it
>>> is
>>> working fine for both points 1&2.
>>>
>>> Your help will be highly appreciated.
>>>
>>> Regards
>>> Venkat
>>> --
>>> View this message in context:
>>> 
> http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13292529
> 
>>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13308959
> 
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13360825
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Please help - Using IBatis in RAD 7.0

Posted by Abhigyan Agrawal1 <ab...@in.ibm.com>.
Hi Venkat,
        The first error you are getting is definitely because of wrong 
jdbc type. 
I tried the code you have given and it gives the same error (register 
output parameters failed) until I change it to VARCHAR instead of 
VARCHAR2. After doing the change, the code is running through iBATIS 
displaying expected results.  Which database are you using? 
        One more thing, you can remove resultClass from procedure as you 
are already giving parameterClass of the same map.
        As far as the transaction is getting timed out is concerned, are 
you providing some timeout values yourself? because I am not and the 
procedure is executing without problem.
 
Cheers,
Abhigyan Agrawal 




IBATIS <ve...@wipro.com> 
20/10/2007 16:45
Please respond to
user-java@ibatis.apache.org


To
user-java@ibatis.apache.org
cc

Subject
Re: Please help - Using IBatis in RAD 7.0







Larry,

Sorry for not being clear with my queries. I have refined my query as 
below.
Please help me out.

I have a stored procedure as below.

CREATE OR REPLACE procedure mytest
                 (
                 In_Bag_ID      in     varchar,
                 In_Station     in     varchar,
                 In_Crtn_Dtm    in     varchar,
                 Out_Bag_Data          out varchar2,
                 Out_Return_Cde        out number)
is
Begin
                 Out_Bag_Data := 'success';
                 Out_Return_Cde := 0;
End mytest;
/


My .xml resource file entry is as below

                 <procedure id="retrieveBagTagInfoSP" 
parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
                 {call mytest 
(#bagid,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
#apcde,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
#crtndtm,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
#bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#,
#returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#)}
                 </procedure>

My Calling java programme is as below.

hshBagTag.put("bagid","");
hshBagTag.put("apcde","");
hshBagTag.put("crtndtm","");
hshBagTag.put("bagdata",new String(""));
hshBagTag.put("returncode", new Integer(0));  

SqlMapperClient.queryForObject("retrieveBagTagInfoSP", 
hshBagTag,hshBagTag);

While I invoke the stored procedure, I am getting the following error

--- The error occurred in com/nwa/safetrac/domain/common/dao/sql/Bags.xml. 
 
--- The error occurred while executing query procedure. 
--- Check the {call mytest (?, ?, ?, ?, ?)}. 
--- Check the output parameters (register output parameters failed). 
--- Cause: java.sql.SQLException: Invalid column type


In the same above I changed the 

#bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#, 
to
#bagdata,javaType=java.lang.String,jdbcType=VARCHAR,mode=OUT#, 

and
#returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#
to
#returncode,javaType=java.lang.Double,jdbcType=DECIMAL,mode=OUT#)

Now, the above error was not occurring but the transaction is getting 
timed
out. 

Could you please tell me where I am going wrong,  I am badly in need of a
help.

My Environment is as below.

Development Environment  -  RAD 7.0 (Websphere Application server 6.0)
Ibatis jar files - ibatis-common-2.jar / ibatis-sqlmap-2.jar (i got it 
from
jpetstore example package)

Regards
Venkat


Larry Meadors-2 wrote:
> 
> I know both work, but without seeing any code...it's impossible for us
> to see what your specific issue is.
> 
> Larry
> 
> 
> On 10/19/07, IBATIS <ve...@wipro.com> wrote:
>>
>> Hi There,
>>
>> I am facing issues while I invoke a sql / stored procedure in RAD 7.0
>> using
>> Ibatis.
>>
>> Do I need add any .jars or others to make it work with RAD.
>>
>> Please look into the issues as below.
>>
>> 1. while I invoke a plain sql I am not getting the result.
>> 2. While I invoke a stored procedure, the transaction is getting timed
>> out.
>>
>> when i invoke the above using ordinary java.sql.connection ( I get this
>> connection object from SqlMapClient.getDataSource().getConnection()) it
>> is
>> working fine for both points 1&2.
>>
>> Your help will be highly appreciated.
>>
>> Regards
>> Venkat
>> --
>> View this message in context:
>> 
http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13292529

>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13308959

Sent from the iBATIS - User - Java mailing list archive at Nabble.com.



Re: Please help - Using IBatis in RAD 7.0

Posted by IBATIS <ve...@wipro.com>.
Larry,

Sorry for not being clear with my queries. I have refined my query as below.
Please help me out.

I have a stored procedure as below.

CREATE OR REPLACE procedure mytest
	(
   	In_Bag_ID      in     varchar,
	In_Station     in     varchar,
	In_Crtn_Dtm    in     varchar,
	Out_Bag_Data          out varchar2,
	Out_Return_Cde        out number)
is
Begin
	Out_Bag_Data := 'success';
	Out_Return_Cde := 0;
End mytest;
/


My .xml resource file entry is as below

	<procedure id="retrieveBagTagInfoSP"  parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
	{call mytest (#bagid,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
#apcde,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
#crtndtm,javaType=java.lang.String,jdbcType=VARCHAR,mode=IN#,
#bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#,
#returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#)}
	</procedure>

My Calling java programme is as below.

hshBagTag.put("bagid","");
hshBagTag.put("apcde","");
hshBagTag.put("crtndtm","");
hshBagTag.put("bagdata",new String(""));
hshBagTag.put("returncode", new Integer(0));			

SqlMapperClient.queryForObject("retrieveBagTagInfoSP", hshBagTag,hshBagTag);

While I invoke the stored procedure, I am getting the following error

--- The error occurred in com/nwa/safetrac/domain/common/dao/sql/Bags.xml.  
--- The error occurred while executing query procedure.  
--- Check the {call mytest (?, ?, ?, ?, ?)}.  
--- Check the output parameters (register output parameters failed).  
--- Cause: java.sql.SQLException: Invalid column type


In the same above I changed the 

#bagdata,javaType=java.lang.String,jdbcType=VARCHAR2,mode=OUT#, 
to
#bagdata,javaType=java.lang.String,jdbcType=VARCHAR,mode=OUT#, 

and
#returncode,javaType=java.lang.Integer,jdbcType=INTEGER,mode=OUT#
to
#returncode,javaType=java.lang.Double,jdbcType=DECIMAL,mode=OUT#)

Now, the above error was not occurring but the transaction is getting timed
out. 

Could you please tell me where I am going wrong,  I am badly in need of a
help.

My Environment is as below.

Development Environment  -  RAD 7.0 (Websphere Application server 6.0)
Ibatis jar files - ibatis-common-2.jar / ibatis-sqlmap-2.jar (i got it from
jpetstore example package)

Regards
Venkat


Larry Meadors-2 wrote:
> 
> I know both work, but without seeing any code...it's impossible for us
> to see what your specific issue is.
> 
> Larry
> 
> 
> On 10/19/07, IBATIS <ve...@wipro.com> wrote:
>>
>> Hi There,
>>
>> I am facing issues while I invoke a sql / stored procedure in RAD 7.0
>> using
>> Ibatis.
>>
>> Do I need add any .jars or others to make it work with RAD.
>>
>> Please look into the issues as below.
>>
>> 1. while I invoke a plain sql I am not getting the result.
>> 2. While I invoke a stored procedure, the transaction is getting timed
>> out.
>>
>> when i invoke the above using ordinary java.sql.connection ( I get this
>> connection object from SqlMapClient.getDataSource().getConnection()) it
>> is
>> working fine for both points 1&2.
>>
>> Your help will be highly appreciated.
>>
>> Regards
>> Venkat
>> --
>> View this message in context:
>> http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13292529
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13308959
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Please help - Using IBatis in RAD 7.0

Posted by Larry Meadors <lm...@apache.org>.
I know both work, but without seeing any code...it's impossible for us
to see what your specific issue is.

Larry


On 10/19/07, IBATIS <ve...@wipro.com> wrote:
>
> Hi There,
>
> I am facing issues while I invoke a sql / stored procedure in RAD 7.0 using
> Ibatis.
>
> Do I need add any .jars or others to make it work with RAD.
>
> Please look into the issues as below.
>
> 1. while I invoke a plain sql I am not getting the result.
> 2. While I invoke a stored procedure, the transaction is getting timed out.
>
> when i invoke the above using ordinary java.sql.connection ( I get this
> connection object from SqlMapClient.getDataSource().getConnection()) it is
> working fine for both points 1&2.
>
> Your help will be highly appreciated.
>
> Regards
> Venkat
> --
> View this message in context: http://www.nabble.com/Please-help---Using-IBatis-in-RAD-7.0-tf4652521.html#a13292529
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>