how to concate a string in insert statement using ibatis?

2010-01-28 Thread suprememenu
hi all, i would like to know how can i contact a string in insert statemnet using ibatis? insert into knet (TRACK_ID, STORE_ID, order_id DATE ) values( #trackId#, #storeId#, 'abc'+#orderId#,

Re: how to concate a string in insert statement using ibatis?

2010-01-28 Thread suprememenu
suprememenu wrote: hi all, i would like to know how can i contact a string in insert statemnet using ibatis? insert into knet (TRACK_ID, STORE_ID, order_id DATE ) values( #trackId#, #storeId#,

RE: how to concate a string in insert statement using ibatis?

2010-01-28 Thread meindert
Best option is to do it on the java side, otherwise you can use 'abc?orderId?' what will insert (sql inject!) the literal value of orderId in your query -Original Message- From: suprememenu [mailto:shaik...@gmail.com] Sent: 28 January 2010 11:55 AM To: user-java@ibatis.apache.org Subject:

RE: how to concate a string in insert statement using ibatis?

2010-01-28 Thread suprememenu
hi , when i try 'abc?orderId?' this its inserting the data like 'abc?orderId?' directlly in the database. meindert-3 wrote: Best option is to do it on the java side, otherwise you can use 'abc?orderId?' what will insert (sql inject!) the literal value of orderId in your query

RE: how to concate a string in insert statement using ibatis?

2010-01-28 Thread suprememenu
hi , i mean its inserting the database but with value as abc?orderId it should insert into db as abc123 (where 123 is the orderId) suprememenu wrote: hi , when i try 'abc?orderId?' this its inserting the data like 'abc?orderId?' directlly in the database. meindert-3

RE: how to concate a string in insert statement using ibatis?

2010-01-28 Thread suprememenu
Hi, I solved the issue from java side . thanks. suprememenu wrote: hi , i mean its inserting the database but with value as abc?orderId it should insert into db as abc123 (where 123 is the orderId) suprememenu wrote: hi , when i try 'abc?orderId?' this its

how to write Sql query in system out or to a log using ibatis?

2010-01-28 Thread suprememenu
hi all, Can anyone can guide me how can i write the sql query in system.out? This query is in a.xml file select id=getDetailsId resultClass=Trans parameterClass=string select sequenceId, name, lastname, mobileNo, from mytable where

RE: how to write Sql query in system out or to a log using ibatis?

2010-01-28 Thread meindert
That question comes up a lot, you can log the actual query if you switch log4j logging on (see documentation) but a) I wouldn't know a easy way to get the query back to your code b) The query is parameterized, the parameter values are in the log Meaning you can get the query string like select

RE: how to write Sql query in system out or to a log using ibatis?

2010-01-28 Thread Tom Henricksen
Use something like log4j and add something like this to your log4j.xml. logger name=java.sql level value=debug / /logger You will get something like this: java.sql.PreparedStatement - {pstm-100028} Executing Statement: SELECT * FROM EMP WHERE EMPNAME = ?

Little question about type check between resultMap and java return type

2010-01-28 Thread Marco Speranza
Hi all I have notice an unusual behaviour of ibatis result object mapping. Mapping a query result with a wrong ResultMap, no error is thrown. My xml mapper is: select id=getSizeItems resultMap=SizeResult SELECT SIZE_ID, DESCRIPTION FROM MY_TABLE /select My

Re: how to concate a string in insert statement using ibatis?

2010-01-28 Thread Jason King
In Oracle || is the string concatenation operator 'abc'||#orderId# should work. suprememenu wrote: suprememenu wrote: hi all, i would like to know how can i contact a string in insert statemnet using ibatis? insert into knet (TRACK_ID, STORE_ID, order_id

Re: Little question about type check between resultMap and java return type

2010-01-28 Thread Nathan Maves
This is a known feature of ibatis 3 :) We have been talking about it but nothing has really come of it. The truth is that the result class you are using must have, at least, the same properties that are being returned. My current opinion is that we should have strict type checking on result

Re: Re: Little question about type check between resultMap and java return type

2010-01-28 Thread Marco Speranza
Hi Nathan tnx for you reply, A strict type checking is a good feature to minimize the errors. Are you planning to implement this check in the future? Thanks a lot. This is a known feature of ibatis 3 :) We have been talking about it but nothing has really come of it. The truth is that

CommitRequired attribute of transactionManager in iBatis 3

2010-01-28 Thread Eduardo M. Cavalcanti
Hello, The CommitRequired attribute of transactionManager, present in iBatis 2 is no longer necessary in iBatis 3? Quote from iBatis 2 manual: The transactionManager element also allows an optional attribute commitRequired that can be true or false. Normally iBATIS will not commit

Re: CommitRequired attribute of transactionManager in iBatis 3

2010-01-28 Thread Clinton Begin
In iBATIS 3, you can use .commit(boolean force) The advantage is that you need not incur the performance penalty for every transaction, and also, it allows frameworks like spring to declaratively configure transactions to be forcefully committed. Your thoughts? Clinton On Thu, Jan 28, 2010 at

Re: CommitRequired attribute of transactionManager in iBatis 3

2010-01-28 Thread Eduardo M. Cavalcanti
Hello Clinton, No repair. I just wanted some clarification on this matter. Thank you. On 28/01/2010 17:22, Clinton Begin wrote: In iBATIS 3, you can use .commit(boolean force) The advantage is that you need not incur the performance penalty for every transaction, and also, it allows

How to configure a ResultHandler when Mapper configured via annotation?

2010-01-28 Thread Paul Spencer
iBatis 3.0-Beta-9 for Java. I have done all of my iBatis configuration via annotations and need to perform a select with a ResultHandler. Using the AuthorMapper defined in the iBatis-3 Users Guide on page 54, how would I add a result handler to selectAuthors()? Paul Spencer

Re: How to configure a ResultHandler when Mapper configured via annotation?

2010-01-28 Thread Clinton Begin
You can't call it through a mapper at this time. You can only call it through the sqlSession#select() method. That said, it might not be hard to add support for that. Clinton On Thu, Jan 28, 2010 at 2:22 PM, Paul Spencer pau...@apache.org wrote: iBatis 3.0-Beta-9 for Java. I have done all