Sorted results not expected

2007-03-21 Thread Tony Jang
hi all I used ORDER BY to get sorted results, but why is it not my expect results? My database is ORACLE 9. Any help will be appreciated Below is my sql statement: SELECT * FROM (select rownum rno, a.a aa, a.b ab, a.c ac, b.a ba, b.b bb, b.

RE: SQL Server JDBC drivers

2007-03-21 Thread Niels Beekman
You are right, my statement will bite you if you're using triggers. However, it is not in any way a concurrency issue so you'll be fine if you don't use triggers. Thanks for the heads up, Niels -Original Message- From: Abdullah Kauchali [mailto:[EMAIL PROTECTED] Sent: donderdag 22 maart

RE: SQL Server JDBC drivers

2007-03-21 Thread Abdullah Kauchali
Avoid using @@Identity and instead use Scope_Identity(). Here is a blogg that summarises the point: http://cf-bill.blogspot.com/2005/08/identity-scopeidentity-identcurrent.html Has links to MSDN for details. Regards, A > -Original Message- > From: Niels Beekman [mailto:[EMAIL PROTECT

Re: Problem using iBatis and transaction management inside Stored procedure

2007-03-21 Thread Clinton Begin
If I'm not mistaken, if you're using transaction management within the stored proc, you have to ensure that the DB connection is set to autocommit. iBATIS doesn't allow autocommit within its own transaction manager, so you'll need to manage your own connection using openSession(Connection)/closeS

FW: SQL Server JDBC drivers

2007-03-21 Thread Niels Beekman
And for the archives... -Original Message- From: Niels Beekman Sent: woensdag 21 maart 2007 20:33 To: 'Mark Volkmann' Subject: RE: SQL Server JDBC drivers Sure: INSERT INTO example (example_column) VALUES (#exampleColumn#) SELECT @@IDENTITY AS ID iBATIS will then popula

Re: Semi complex mapping question

2007-03-21 Thread Ted Schrader
Thanks for posting your solution; you've answered my question as well! Tell your boss I said it was okay for you to take the rest of the day off. ;) Ted On 21/03/07, Mikael Andersson <[EMAIL PROTECTED]> wrote: Hi, I had a bit of a breakthrough :) Ditched the subselect; started experimenting w

Re: Semi complex mapping question

2007-03-21 Thread Ted Schrader
Hi Mike, I see where you found the composite key syntax in the Developer's Guide ("Composite Keys or Multiple Complex Parameters Properties"). The guide does make it sound like the values are being passed in to the nested select. I've run out of ideas. However, when you get this approach worki

Re: Semi complex mapping question

2007-03-21 Thread Mikael Andersson
Hi, I had a bit of a breakthrough :) Ditched the subselect; started experimenting with using resultMap and groupBy instead of select attribute and got it working. Important change (for new users): I assume this is the preferred way of doing things as well, so I'm happy. Thanks,

Re: Usage of namespace and select ids

2007-03-21 Thread Mikael Andersson
Sorry for that question, quick search through the PDF manual revealed that statement namespaces needs to be enabled. On 21/03/07, Mikael Andersson <[EMAIL PROTECTED]> wrote: Hi, I have yet another beginner question. Can I have the same select id in multiple sqlMap XML files? Currently I have

Usage of namespace and select ids

2007-03-21 Thread Mikael Andersson
Hi, I have yet another beginner question. Can I have the same select id in multiple sqlMap XML files? Currently I have two sqlMap XML files, which are specifying namespace (generated by Abator, with custom stuff added to them), with the same select id in both files. When invoking a query in the

RE: SQL Server JDBC drivers

2007-03-21 Thread Rose, Greg
I have been using jTDS for the past 2 years with SQL Server 2005. Greg Rose Sr. Java Developer/Team Lead| ICE Project 9002 San Marco Ct. Orlando, FL 32819 Office > 407.903.4757 | Fax > 407.903.4856 [EMAIL PROTECTED] -Original Message- From: Mark Volkmann [mailto:[EMAIL PROTECTED]

RE: SQL Server JDBC drivers

2007-03-21 Thread Graeme J Sweeney
On Wed, 21 Mar 2007, Niels Beekman wrote: We use jTDS (http://jtds.sf.net) for several years now, it has excellent performance and any bugs (which are very rare) are dealt with promptly. +1 -- Graeme -

RE: SQL Server JDBC drivers

2007-03-21 Thread Niels Beekman
Hi, We use jTDS (http://jtds.sf.net) for several years now, it has excellent performance and any bugs (which are very rare) are dealt with promptly. Niels -Original Message- From: Mark Volkmann [mailto:[EMAIL PROTECTED] Sent: woensdag 21 maart 2007 17:28 To: user-java@ibatis.apache.org

Re: Semi complex mapping question

2007-03-21 Thread Mikael Andersson
Hi Thanks for the help so far. I thought that this bit: wrote: Hi Mike, Okay, I think I know what the immediate problem is. Again, your nested query goes like this: select VALUE, OFFSET from dbo.CURVE where CURVE_NAME = #curveName# and CURVE

SQL Server JDBC drivers

2007-03-21 Thread Mark Volkmann
If you have successfully used iBATIS with SQL Server, can you tell me what JDBC driver(s) have worked for you?

Re: Semi complex mapping question

2007-03-21 Thread Ted Schrader
Hi Mike, Okay, I think I know what the immediate problem is. Again, your nested query goes like this: select VALUE, OFFSET from dbo.CURVE where CURVE_NAME = #curveName# and CURVE_CATEGORY = #curveCategory# So, if you pass in null as your paramete

Re: Locale problems?

2007-03-21 Thread andrew . kitchen
All, Sorry for yet another post..but I have made a further development If I remove the selection of the 'dob' column, which is the 'date' type column, and remove it from the resultMap it works fine. Therefore it has to be something to do with the interaction with the 'date' column itself.

Re: Semi complex mapping question

2007-03-21 Thread Mikael Andersson
Forgot to add that suggestions for better approaches would be greatly appreciated (trying to do it with resultMap attribute at the moment). - Mike On 21/03/07, Mikael Andersson <[EMAIL PROTECTED]> wrote: Hi Ted, just started using iBATIS and the manual contains a similar approach, that is why

Workaround for paginated groupBy?

2007-03-21 Thread Ezequiel Bertran
Hi, There are a solution for combine the ideas of pagination and group By?, i read in documentation that it can return unexpected results (and i realized that) If someone know a workaround i will appreciate it Thanks eznibe

Re: Semi complex mapping question

2007-03-21 Thread Mikael Andersson
Hi Ted, just started using iBATIS and the manual contains a similar approach, that is why I did it that way. I figured I would get that working and then tackle the problem of N+1 select statements. The table contains lots and lots of curves, where each curve has many curve points. Stupid design I

Re: Semi complex mapping question

2007-03-21 Thread Ted Schrader
Hi Mike, How are you calling the mapped statement on the Java side? Also, it's not clear why you're going to the trouble of a nested select ("getCurvePoints") when it seems from your table design that there will be one and only one x-y pair for a primary key. Would you elaborate on why you are

Re: Locale problems?

2007-03-21 Thread andrew . kitchen
OK - i'll have a look later today. One other interesting thing is this - if I remove the lastLogin column from the query and the resultMap I get this error - which seems to show that lastLogin is a red herring: com.ibatis.dao.client.DaoException: Failed to execute queryForObject - id [getUse

Re: Locale problems?

2007-03-21 Thread Graeme J Sweeney
On Wed, 21 Mar 2007, [EMAIL PROTECTED] wrote: I think the two errors are unconnected. The unparseable 'date' shown is from the dob column not the lastLogin column. I think that is a red herring. I have no idea why 'lastLogin' is causing an issue as well. The value is from the dob column but iB

Re: Locale problems?

2007-03-21 Thread Stefan Langer
[EMAIL PROTECTED] schrieb: Hi Greame, Thanks for your efforts again. --- Check the result mapping for the 'lastLogin' property. --- Cause: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of 'BaseObject [107, null, null, null]'. Cause: java.text.Pa

Re: How to handle Insert and update of 1:N objects

2007-03-21 Thread Larry Meadors
No, there is not a way to do that automatically, you have to insert (or update) the parent, then iterate through the child records in code inserting (or updating) them. Larry On 3/21/07, daheri <[EMAIL PROTECTED]> wrote: I've just started out with iBATIS and have not found any information on t

Re: Locale problems?

2007-03-21 Thread andrew . kitchen
Hi Greame, Thanks for your efforts again. > > --- Check the result mapping for the 'lastLogin' property. > > --- Cause: com.ibatis.common.exception.NestedRuntimeException: > Error > > setting properties of 'BaseObject [107, null, null, null]'. Cause: > > java.text.ParseException: Unparseable dat

Re: Locale problems?

2007-03-21 Thread Graeme J Sweeney
On Tue, 20 Mar 2007, [EMAIL PROTECTED] wrote: --- Check the result mapping for the 'lastLogin' property. --- Cause: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of 'BaseObject [107, null, null, null]'. Cause: java.text.ParseException: Unparseable date: "1975-01-1

How to handle Insert and update of 1:N objects

2007-03-21 Thread daheri
Hi, I've just started out with iBATIS and have not found any information on this subject anywhere. I have one javabean (ITEM) containing a list of other javabeans (ALTERNATIVE). I was hoping to handle everything through a ItemDAO. The iBATIS mapping for the selects works perfectly. Then I can cr

Semi complex mapping question

2007-03-21 Thread Mikael Andersson
Hi, I'm new to iBATIS and need some help with a problem I'm having. I have a table called CURVE which contains curve points for loads of curves (graph curves), where each curve can have a dynamic number of curve points. Table structure: CURVE_NAME | CURVE_CATEGORY | OFFSET | VALUE CURVE_NAME an