WHAT AM I MISSING? sqlMapConfig.xml

2006-05-16 Thread xianwinwin
Newbie to iBatis: I have this sqlMapConfig.xml but for some reason it generates the following error: Element "sqlMapConfig" requires additional elements. (to be more mercise, it says: Caused by: com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.Nod

Re: Re : Problem with iBatis SQLMap and stored procedure

2006-05-16 Thread Beemsterboer Software
Hi, As you've already pointed out in the stacktrace, the problem "clearly" comes from DBCP: Caused by: java.lang.NullPointerException at org.apache.commons.dbcp.DelegatingResultSet.close(DelegatingResultSet.java:132) I haven't met this problem before, but I already had Tomcat working w

Re: get id with iBatis (Statement.RETURN_GENERATED_KEYS)

2006-05-16 Thread xianwinwin
ok, I think I'm getting somewhere, I changed my SqlMapConfig from: to it appears that the xml is ok (nothing crushes) but, when i get to the exec point, i get this message: There is no statement named addNewTA in this SqlMap. -- View this message in context: http://www.nabble.com/get-id-wit

Re: get id with iBatis (Statement.RETURN_GENERATED_KEYS)

2006-05-16 Thread Jeff Butler
These are simple XML errors.  Please make sure that you are using the latest version of iBATIS (2.1.7) and that you've set the DOCTYPE of all your config files to the new DTD's specified on the bottom of the iBATIS home page at http://ibatis.apache.org   The example I gave in my last post should w

Re: get id with iBatis (Statement.RETURN_GENERATED_KEYS)

2006-05-16 Thread xianwinwin
error: Document root element is missing. Jeff, do you have any example I can look at which might assist me? I also get those errors: Element type "insert" must be declared Element type "selectKey" must be declared thanks again -- View this message in context: http://www.nabble.com/get-id-with-

Re: get id with iBatis (Statement.RETURN_GENERATED_KEYS)

2006-05-16 Thread Jeff Butler
This is probably a result of using some iBATIS 2.0 elements inside an iBATIS 1.0 sql map.  You need to consistently use the version 2.0 DTD like this:     PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"  "http://ibatis.apache.org/dtd/sql-map-2.dtd"> resultClass="int">      SELEC

Re: How to set connection isolation level with iBatis DAO and SQL Mapper framework?

2006-05-16 Thread Eric Tan
I just found out that since 2.0.9, isolation level is supported at the SQL Map framework, eg.sqlMap.startTransaction(Connection.TRANSACTION_REPEATABLE_READ);However, from the DAO framework, there is still no way to specify an isolation level using the DaoManager.startTransaction().Is there a way to

Re: get id with iBatis (Statement.RETURN_GENERATED_KEYS)

2006-05-16 Thread xianwinwin
thank you for your reply Jeff. I looked at the documentation and tried (unsuccessfully) some of the examples. I tried somthing that looks like this: http://www.ibatis.com/dtd/sql-map.dtd";> SELECT LAST_INSERT_ID() AS value INS

Re: get id with iBatis (Statement.RETURN_GENERATED_KEYS)

2006-05-16 Thread Jeff Butler
Take a look at in the iBATIS documentation.   Jeff Butler   On 5/16/06, xianwinwin <[EMAIL PROTECTED]> wrote: Hi guys I am new to iBatis. My question is very simple, in the old days I used to write a statement such as the one below to get the the GENERATED_KEYS. in other words, this statement ret

Re : Problem with iBatis SQLMap and stored procedure

2006-05-16 Thread Cyril
Hi, I tried your suggestion and it works ! I was very surprised, because I downloaded DBCP sources and managed to continue my debugging. It suggested that the CallbackStatement.execute() didn't return any result; but since it is a DelegatingCallableStatement, I suspected there may be some kind

get id with iBatis (Statement.RETURN_GENERATED_KEYS)

2006-05-16 Thread xianwinwin
Hi guys I am new to iBatis. My question is very simple, in the old days I used to write a statement such as the one below to get the the GENERATED_KEYS. in other words, this statement return the id of the new recod. Statement stmt1 = con.createStatement(); stmt1

Re: Problem with iBatis SQLMap and stored procedure

2006-05-16 Thread Beemsterboer Software
Hi Cyril, Can you try to configure the Tomcat Datasource without DBCP? For example, here is a configuration for MySQL: username password driverClassName com.mysql.jdbc.Driver url jdbc:mysql:///test?jdbcCompliantTruncatio

Re: isEmpty question

2006-05-16 Thread Nathan Maves
This is a simple java issue. String string = null; String string2 = "myString"; string.equals(string2);<-- bam NPE That is what you are trying to do in your code. I would suggest using the isNotNull around your isEquals tag. Nathan On May 16, 2006, at 2:35 AM, Zsolt wrote: Hi, I g

Problem with iBatis SQLMap and stored procedure

2006-05-16 Thread Cyril
Hi everybody, Please, can you help me? I'm migrating a web application from proprietary JDBC framework to iBatis. Every data retrieving from the database come from stored procedure. I managed to refactor a small unit, after some difficulties finding the correct syntax for stored procedure retur

Optimize fetches for stored procedures

2006-05-16 Thread Amit Kushwaha
Hi All, We need to use iBATIS to map Oracle stored procedure returning result-sets to domain objects. The stored procs could return huge result-sets all of which may not be used in the view.  And we would like to, 1. Limit the number of results returned by the SQL using a SQL clause 2. Opti

isEmpty question

2006-05-16 Thread Zsolt
Hi, I get an exception if a use "