Re: where can I find a simple implementation example

2005-08-18 Thread Salim Madjd
Thanks, Larry! I guess I'll take a look at spring. I am beginning to think it might be faster to just go directly with JDBC and refactor later as I become more comfortable with Spring and ibatis.   Thanks again,   SalimLarry Meadors <[EMAIL PROTECTED]> wrote: Oops, i only replied to salim...--

queryForPaginatedList

2005-08-18 Thread Eugeny N Dzhurinsky
Could somebody please explain, how this works? Does it use the limit/offset or it simply extracts all the data and then navigates on the big list to find a subset? -- Eugene N Dzhurinsky

RE: Getting auto-generated keys in mySql

2005-08-18 Thread Meindert
Hi all, I forgot to use the mysql syntax and it still worked INSERT INTO StateAccess(SupervisorLevel, GroupId, EmpId, LayoutId) VALUES(#supervisorLevel#, #groupId#, #empId#, #layoutId#) SELECT @@IDENTITY AS ID Populated state.getOwnerAccess.stateAcc

RE: Getting auto-generated keys in mySql

2005-08-18 Thread James, Steven
This has been available since MySQL 3.23.25 Steve -Original Message- From: Meindert [mailto:[EMAIL PROTECTED] Sent: Thu 8/18/2005 11:13 AM To: user-java@ibatis.apache.org; [EMAIL PROTECTED] Subject: RE: Getting auto-generated keys in mySql Hi all, I forgot to use the mysql syntax and

Re: where can I find a simple implementation example

2005-08-18 Thread Larry Meadors
Having done a lot of JDBC coding myself, I do not think that is a great idea - I'd suggest spending the time to understand iBATIS first. It may take you a day or two to get rolling with it, but once you are using it, you will cut out a TON of coding that would be required with JDBC. Larry On 8/

RE: where can I find a simple implementation example

2005-08-18 Thread Priyesh Mashelkar
I agree with Larry. Refactor later would be more tedious as per my experience. The application on which I am working is also small but using iBatis has made the db access simpler. -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, August 18, 2005 5:21 PM To:

Re: Getting auto-generated keys in mySql

2005-08-18 Thread Larry Meadors
I believe that this method is "connection-aware" - so it returns the last id generated by this connection. On a related note, @@IDENTITY is not always safe in M$SQL, either. :-) If you have an insert that has a trigger that does another insert, it returns the second inserted key. The SCOPE_IDENTI

Re: preparation failed "UndeclaredThrowableException"

2005-08-18 Thread Larry Meadors
We need more info...can you give us a stack trace? Is "item" a type alias? Larry On 8/17/05, Warren Bell <[EMAIL PROTECTED]> wrote: > I am getting a preparation falied "UndeclaredThrowableException" when I > call: > > return (Integer) executeQueryForObject("getTaxable", item); > > The SQL Ma

AW: Getting auto-generated keys in mySql

2005-08-18 Thread Jaime Ocampo
Yes, there is no problem with mySql. 'select LAST_INSERT_ID()' is 'connection-aware', so you will always obtain YOUR last autoincrement value, regardless of other users' activities. I am using it with success (remarkably, after 4 hours of learning iBatis), like in this example: insert

SQL logging again

2005-08-18 Thread Eugeny N Dzhurinsky
log4j.rootLogger=ERROR, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p %d{dd/mm/yy hh:mm:ss} [%t] (%C{1}:%L) - %m%n log4j.logger.com.ibatis=INFO log4j.logger.com.greenvalle

unchained stored procedure problem

2005-08-18 Thread Li, Daniel \(MSCIBARRA\)
Hi,   I am trying to run several stored procedures in Sybase and get the following error:   com.ibatis.common.jdbc.exception.NestedSQLException:   --- The error occurred in com/msdw/msci/core/db/Country.xml.  --- The error occurred while applying a parameter map.  --- Check the getCountrie

Select n+1 Problem

2005-08-18 Thread Dominic.Sterchi
Hi Concerning the developer guide, it is possible to avoid the select n+1 problem I have something like this: Java: Class Category{ String name; Collection itemList; public void setItemList(Collection _itemList) { this.itemList = _itemList;

How to get table metadata?

2005-08-18 Thread Konda, Sreenivasulu \(Consultant\)
Hi,   I would like to know whether or not we can retrieve table metadata such as table name, column name/type, etc... when used iBatis.   In JDBC, there is a class ResultSetMetaData, which gives us the metadata of underlying table(s), column name, type, etc.   Is there any API to get these

RE: How to get table metadata?

2005-08-18 Thread Folashade Adeyosoye
Not that I know of, I tried this a while back to dynamically get my column names. If you find a solution please let us know.   From: Konda, Sreenivasulu (Consultant) [mailto:[EMAIL PROTECTED] Sent: Thursday, August 18, 2005 10:06 AM To: user-java@ibatis.apache.org Subject: How to

RE: preparation failed "UndeclaredThrowableException"

2005-08-18 Thread Warren Bell
Yes, item is a type alias. I run this SELECT in a db client, and it works fine. I am running this on Sybase, using an ODBC driver on Windows. I have not had any luck using Sybase's JDBC driver. I know that ODBC drivers can be a problem, and I am wondering if that may be the cause. Here is the Ibati

Re: unchained stored procedure problem

2005-08-18 Thread dragos moraru
 Run this: sp_procxmode name_procedure, anymode   - Original Message - From: Li, Daniel (MSCIBARRA) To: user-java@ibatis.apache.org Sent: Wednesday, August 17, 2005 7:34 PM Subject: unchained stored procedure problem Hi,   I am trying to run s

RE: Transaction question

2005-08-18 Thread Barnett, Brian W.
Niels, Thanks for the info. Maybe I am not totally understanding how your modified code works, but is it meant to handle nested transactions? If a transaction has already been started, then your modified code will simply call invoke. I understand that. What happens when a nested transaction calls

RE: Transaction question

2005-08-18 Thread Prashanth Sukumaran
Hi, Do we really have to do all this in the name of reusability. Can't you change the way you code? Can't you overload/refactor a method and have the transaction externalized. Assume you have methodA startTransaction(); // do some business logic. callDAO.doSomething(); endTransacti

RE: How to get table metadata?

2005-08-18 Thread Konda, Sreenivasulu \(Consultant\)
Hi,   I have not got any solution yet. Can you please share the idea to get the column names dynamically?   Thanks and regards, Sreenivas From: Folashade Adeyosoye [mailto:[EMAIL PROTECTED] Sent: Thursday, August 18, 2005 10:08 AMTo: user-java@ibatis.apache.orgSubject: RE: How to get tabl

RE: Transaction question

2005-08-18 Thread Barnett, Brian W.
Prashanth, Your suggestion is precisely what I did on a previous project. (The "service delegate" mentioned below.) I had a whole slug of methods whose sole responsibility was to start and end transactions, and it got cumbersome. For example, I might have an updateWidget() method in a service layer

RE: How to get table metadata?

2005-08-18 Thread Prashanth Sukumaran
Hi Sreenivasulu, Can you tell us what you want to do with the column names? Also you may try to get it this way. SqlMapDaoTemplate.getSqlMapExecutor() will give you the sqlMapClient handle. Then you do sqlMapClient.getDelegate() will give you the handle to com.ibatis.sqlmap.engine.impl.SqlMa

RE: How to get table metadata?

2005-08-18 Thread Prashanth Sukumaran
Hi, Also be careful not to update or modify any of these hash maps. Rgds Prashanth. --- Prashanth Sukumaran <[EMAIL PROTECTED]> wrote: > Hi Sreenivasulu, > > Can you tell us what you want to do with the column names? > > Also you may try to get it this way. > > SqlMapDaoTemplate.getSqlMap

RE: How to get table metadata?

2005-08-18 Thread Folashade Adeyosoye
I use mine to back up my database, by passing in the table name into a method, and this methods creates a flat file with a whole bunch of inserts, that I can use to repopulate the table if I need to. public StringBuffer systemDatabaseBackup(String tableName) throws DaoException { Connection

Re: How to get table metadata?

2005-08-18 Thread Larry Meadors
Wouldn't a tool like dbunit do this better? Larry On 8/18/05, Folashade Adeyosoye <[EMAIL PROTECTED]> wrote: > I use mine to back up my database, by passing in the table name into a > method, and this methods creates a flat file with a whole bunch of inserts, > that I can use to repopulate the t

Re: How to get table metadata?

2005-08-18 Thread Koka
I believe iBatis is all about bypassing handling resultsets and statements, so doubt it will provide much aid in retrieving ResultSetMetaData. Instead, if I needed information about columns etc. I'd just use selects (mapped through iBatis) from database Data Dictionary. Good luck Koka

Is there a way secure the password used in sql-map-config.xml file

2005-08-18 Thread Jason Hall
Title: Is there a way secure the password used in sql-map-config.xml file Hi, Just wanted to know if there is a way? Thanks, JH.

RE: preparation failed "UndeclaredThrowableException"

2005-08-18 Thread Warren Bell
My mistake, SQL SELECT incorrect. -Original Message- From: Warren Bell [mailto:[EMAIL PROTECTED] Sent: Thursday, August 18, 2005 7:09 AM To: user-java@ibatis.apache.org; [EMAIL PROTECTED] Subject: RE: preparation failed "UndeclaredThrowableException" Yes, item is a type alias. I run this

Re: Is there a way secure the password used in sql-map-config.xml file

2005-08-18 Thread Larry Meadors
You might be able to create a datasource factory to do that, but by default, no. Larry On 8/18/05, Jason Hall <[EMAIL PROTECTED]> wrote: > > > Hi, > > Just wanted to know if there is a way? > > Thanks, > > JH.

RE: Is there a way secure the password used in sql-map-config.xml file

2005-08-18 Thread Jason Hall
thanks! JH. -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, August 18, 2005 3:06 PM To: user-java@ibatis.apache.org Subject: Re: Is there a way secure the password used in sql-map-config.xml file You might be able to create a datasource factory to do that

RE: How to get table metadata?

2005-08-18 Thread Folashade Adeyosoye
This is a utility packaged with an application I wrote, all they have to do is click on a link and the entire DB is backed up with a time stamp as the file name, this way they can go back and restore he DB if need be. -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sen

A shot in the dark about unit testing.

2005-08-18 Thread Nathan Maves
We have been using DBUnit for a while now, but seeing as it is as close to a dead project we are looking for something comparable. What is everyone else using? If you are using DBUnit and know how to use BLOB's with it you can be my new hero. Nathan

Re: A shot in the dark about unit testing.

2005-08-18 Thread Mark Bennett
I've been using it. It's not the coolest thing in the world but I like its support for spreadsheets.  I suppose with Java 5 coming out that there might be some alternatives coming about with nice features.  Don't know of any though.   Mark  On 8/18/05, Nathan Maves <[EMAIL PROTECTED]> wrote: We ha

Re: A shot in the dark about unit testing.

2005-08-18 Thread Nathan Maves
What do you mean support for spreadsheets?NathanOn Aug 18, 2005, at 2:27 PM, Mark Bennett wrote:I've been using it. It's not the coolest thing in the world but I like its support for spreadsheets.  I suppose with Java 5 coming out that there might be some alternatives coming about with nice feature

Re: A shot in the dark about unit testing.

2005-08-18 Thread Mark Bennett
 protected IDataSet getDataSet() throws Exception {  return new XlsDataSet(new FileInputStream(dataSetLocation)); }  I type the records I want in a spreadsheet.  Each worksheet represents a table.   Mark  On 8/18/05, Nathan Maves <[EMAIL PROTECTED]> wrote: What do you mean support for spreadsheets?

NULL Java Integers to Oracle NUMBER

2005-08-18 Thread Mathew Samuel
How do I save NULL Java Integers into Oracle where the field is defined as a NUMBER. For a Java String to VARCHAR2, I can get away with #value:VARCHAR:NO_ENTRY# #numericValue:NUMBER# doesn't seem to work. I'd like to know how to do this without parameterMaps, unless that's the ONLY way. Thanks,

Re: NULL Java Integers to Oracle NUMBER

2005-08-18 Thread Mathew Samuel
Looks like #numericValue:NUMERIC# is the way to go. Does anyone here know if there's a new DataMapperDevGuide.pdf out there ? A short while ago I'd opened a ticket on JIRA regarding truncated entries within this guide. http://issues.apache.org/jira/browse/IBATIS-181 --- Mathew Samuel <[EMA