Re: Configure Ibatis to Auto-Truncate Property length when Insert to Database?

2006-09-22 Thread Nathan Maves
you could also do it via your sql insert into TABLE (COL1, ... values ( SUBSTR(#property1:NUMERIC#, 0, 25) SUBSTR(#property2:VARCHAR#, 0, 30) SUBSTR(#property3:VARCHAR#, 0, 30) On 9/22/06, Larry Meadors [EMAIL PROTECTED] wrote: I'd do it in a getter. Larry On 9/22/06, Mississippi John Hurt

Re: To monitor used cache model size

2006-09-22 Thread Nathan Maves
Hmm... if you really plan to keep all available values in the cache why not just load them all into memory at startup of your app. In your case you are using an LRU cache which is designed for maximizing performance for you most used objects, while limiting your footprint in memory. To answer

Re: iBATIS - Joins ?

2006-09-21 Thread Nathan Maves
The ibatis framework has no clue about how you write your sql. it only maps the results of your query.NathanOn 9/21/06, Pradheep [EMAIL PROTECTED] wrote: hey can anyone let me know how to work on joins in iBATIS. this is the query i am goin to use. select a.versionnumber, a.releasedate,

Re: oracle and dbcp

2006-09-20 Thread Nathan Maves
-Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 20, 2006 4:16 PM To: user-java@ibatis.apache.org Subject: Re: oracle and dbcp post your config info? On 9/20/06, Robert King [EMAIL PROTECTED] wrote: I am having trouble configuring dbcp using

Re: oracle and dbcp

2006-09-20 Thread Nathan Maves
is doing a connect on every database access. Any suggestions? -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 20, 2006 5:20 PM To: user-java@ibatis.apache.org Subject: Re: oracle and dbcp Guide even and it can be found http://cvs.apache.org/dist

Re: TypeHandlerCallback class for Oracle's XMLType

2006-09-18 Thread Nathan Maves
Very cool thanks for the work Jan, Nathan On 9/18/06, Jan Vissers [EMAIL PROTECTED] wrote: I've just added a TypeHandlerCallback class capable of mapping Oracle's XMLType column to an org.w3c.dom.Document instance to the wiki.

Re: SIMPLE or DBCP

2006-09-17 Thread Nathan Maves
The simple database connection pool is just that simple. If it works for you then great! if not I would suggest the apache commons DBCP. It is robust enough for almost every application. Nathan On 9/17/06, class acts [EMAIL PROTECTED] wrote: Hi All, I'm evaluating iBATIS after having

Re: queryForList problem

2006-09-13 Thread Nathan Maves
You need to specify your resultClass as string and then call queryForList On 9/13/06, Okan Çetin [EMAIL PROTECTED] wrote: Hi all; I want to get some data from database that using ibatis The code: Integer user_id=usr.getuser_id (); List

Re: underscore in java bean property

2006-09-13 Thread Nathan Maves
: Even if they don't follow the spec, here is a work around: Create a object wrapper that DOES follow the spec, and it just delegates to the legacy object. If you can, however, I would refactor it to be more appropriate for modern coding practices. -Original Message- From: Nathan Maves

Re: How to use sqlmap to create an object with not empty construnctor

2006-09-11 Thread Nathan Maves
Ahh how about you just add an empty constructor... public TestA() { this(); } Problem solved. On 9/11/06, Anthony Hong [EMAIL PROTECTED] wrote: I have a class, class testA() { public testA(String name) { } } can it be used in result-map, if can how to write result map -- Anthony

Re: [RESOLVED] Re: Problem with multi-select inside a resultMap since Ibatis 2.20 (colored...)

2006-09-08 Thread Nathan Maves
PROTECTED] wrote: It's the mystery of life... ;-) No, I can't tell you why I injected the dataSource into my DAO. But both seems to be correct... Nathan Maves a écrit : Now that you found the difference can you tell us why you were injecting a datasource into your dao? My applications are configured

Re: Abator Ibatis with struts example required

2006-09-07 Thread Nathan Maves
Let me make sure you know what you are asking for. First off Abator is a sql map generation tool. It has nothing to do with any web framework such as struts. If you are looking for a tutorial on how to use the sql map framework with struts then check out a great site

Re: [RESOLVED] Re: Problem with multi-select inside a resultMap since Ibatis 2.20 (colored...)

2006-09-07 Thread Nathan Maves
Now that you found the difference can you tell us why you were injecting a datasource into your dao? My applications are configured the same was Jeff's are. On 9/7/06, TNO [EMAIL PROTECTED] wrote: This is problem Spring/Ibatis ! By examinig your bean, the only difference was the injection

Re: Retry Logic

2006-08-31 Thread Nathan Maves
I was just going to suggest that. We here use Oracle and this option automaticlly set. If the process does reach this timeout you will get an exception. But in this case there is most likely something more serious wrong. Nathan On 8/30/06, Brad Balmer [EMAIL PROTECTED] wrote: What I'm going

Re: Dynamically set ORDER BY sort Column and its order

2006-08-30 Thread Nathan Maves
. Regards, Kiran -Original Message-From: Nathan Maves [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 29, 2006 9:11 PMTo: user-java@ibatis.apache.orgSubject: Re: Dynamically set ORDER BY sort Column and its orderThis can easily be done in ibatis but I might suggest other ways of doing

Re: Resource load problem

2006-08-30 Thread Nathan Maves
Out of curiosity why would you do this? On 8/30/06, Javier Leyba [EMAIL PROTECTED] wrote: On 8/29/06, Larry Meadors [EMAIL PROTECTED] wrote: If you use a filename, it is no longer considered a resource. You could use this, though: String smcPath = System.getProperty(jboss.server.home.dir)

Re: Dynamically set ORDER BY sort Column and its order

2006-08-29 Thread Nathan Maves
This can easily be done in ibatis but I might suggest other ways of doing this. In ibatis you could send the name of the column or even the number value in as a parameter. Then just have a dynamic section on the end. ...ORDER BY $sortByColumn$Since your results will always be the same there is no

Re: M:N question

2006-08-24 Thread Nathan Maves
Ok you got me confused on this post. In your class Foo you have a Map with keys that point to a list. Does this mean that your key would be the a from the marMap table and the ListInteger is the b How about a real world example. What does this Map represent? How about an Invoice with

Re: CDATA inside or outside of statement tag

2006-08-23 Thread Nathan Maves
I tend to not use them at all. The only time I would need them is for the standard less then or greater then symbols. Instead I just use the html code to do this. gt; and lt; On 8/23/06, Daniel Pitts [EMAIL PROTECTED] wrote: I believe the cdata start/end will cause the dynamic tags to be

Re: JUnit and iBatis

2006-08-22 Thread Nathan Maves
Are you looking to test your own code or the ibatis code base?On 8/22/06, Juanjo Cuadrado [EMAIL PROTECTED] wrote:Hi, I'm new in iBatis and I need to do unit tests with it (JUnit). Anyone can tell me how to use both tools? A manual or any kind of documentation about this will also be welcome.

Re: null pointer exception when updating sqlMap

2006-08-22 Thread Nathan Maves
Try specifing the JDBC type in you update. Something like... #lastModifiedBy:DATE# #numOrder:NUMBER# #lastModifiedBy:VARCHAR# Of course use what ever data type you need to. On 8/22/06, Sourav Sen [EMAIL PROTECTED] wrote: Hi, It gives me a NullPointerException when trying to update a

Re: ---- Re: null pointer exception when updating sqlMap

2006-08-22 Thread Nathan Maves
Do what I told you and it will call the correct setNull() for the specific column. On 8/22/06, Sourav Sen [EMAIL PROTECTED] wrote: Hi , A normal Javabean with a no-args public constructor and loads of getters and setters. There must be a way to tell iBatis to ignore nulls public

Re: Updating from ibatis 1.3.1 to 2.1.7 .. what about this one .. how to access the resultSet because performance matters

2006-08-17 Thread Nathan Maves
Not sure when this was but stored proc calls can use a parameterMap.The issue of using straight JDBC has come up multiple times and everytime, in the end, they see that there is really no reason to. Supply a good reason and you might change my mind. NathanOn 8/17/06, David Gagnon [EMAIL PROTECTED]

Re: Properties not loaded after first null (sometimes)

2006-08-15 Thread Nathan Maves
Are you by any chance using a Custom Type Handler? If so please post the CTH code.On 8/15/06, Juan Alvarez [EMAIL PROTECTED] wrote: Hi, I'm suffering some really strange phenomenon with Ibatis (2.1.6.589). In some of my maps I discovered that when a particular field came with a null valued from

Re: Updating from ibatis 1.3.1 to 2.1.7 .. should I? Does it worth the effort?

2006-08-14 Thread Nathan Maves
I concure. Please upgrade and let us know if you have any problems. nathan On 8/14/06, Jeff Butler [EMAIL PROTECTED] wrote: You can use the Ant task to upgrade your sql maps, or just a find/replace. On one project with about 80 result maps I did it with find/replace - it's pretty easy. The only

Re: Updating from ibatis 1.3.1 to 2.1.7 .. should I? Does it worth the effort?

2006-08-14 Thread Nathan Maves
I even *concur* :)On 8/14/06, Nathan Maves [EMAIL PROTECTED] wrote: I concure. Please upgrade and let us know if you have any problems. nathan On 8/14/06, Jeff Butler [EMAIL PROTECTED] wrote: You can use the Ant task to upgrade your sql maps, or just a find/replace. On one project with about 80

Re: Exception while setting properties

2006-08-14 Thread Nathan Maves
what version of the jdk are you using? can you post the sqlmap as well as the set/get method of the property that you are having issues with? On 8/14/06, Eugeny N Dzhurinsky [EMAIL PROTECTED] wrote: On Mon, Aug 14, 2006 at 09:38:02AM -0600, Larry Meadors wrote:The simplest solution is for you to

Re: Exception while setting properties

2006-08-14 Thread Nathan Maves
Eugeny that is why I asked what jdk you are using. If you can run java 1.5 you will not have these issues. nathanOn 8/14/06, Larry Meadors [EMAIL PROTECTED] wrote: Ahh, yeah, you can't set an int to null, if the values can be null, they have to be Integer instead.Larry On 8/14/06, Eugeny N

Fwd: more details..

2006-08-11 Thread Nathan Maves
-- Forwarded message --From: Nathan Maves [EMAIL PROTECTED]Date: Aug 11, 2006 12:52 PM Subject: Re: more details..To: Khanna, Vijay (GE, Corporate, consultant) [EMAIL PROTECTED]Cc: [EMAIL PROTECTED] As I said please do not send me direct emails... The is a community project

Re: Duplicate typeHandler (same javaType, different jdbcType)

2006-08-10 Thread Nathan Maves
Just a thought but why are you writing your own Date/Timestamp handlers? Both of these are covered by TypeHandlers that are bundled with ibatis. You can find their code here http://svn.apache.org/repos/asf/ibatis/ trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/type/ If you are

Re: pagination

2006-08-10 Thread Nathan Maves
If you are looking for ibatis to write the jsp that will never happen.                   Pagination can be achieved by simple jslt and queryForList().NathanOn Aug 10, 2006, at 1:42 AM, puneet arya wrote:Hi,     Can anybody tell me the link or way(code) to achieve pagination through Ibatis and

Re: When to use jdbcType or javaType

2006-08-10 Thread Nathan Maves
Quite the vague question The short answer is no. ibatis will do its best to figure out how what to use. It can only help to specify the jdbcType. Nathan On Aug 10, 2006, at 9:38 AM, jaybytez wrote: Do you need jdbcType on both parameterMap and resultMap? thanks! jay -- View this

Re: When to use jdbcType or javaType

2006-08-10 Thread Nathan Maves
I think you will find that using javaType and jdbcType on result maps will give you a performance boost.On 8/10/06, jaybytez [EMAIL PROTECTED] wrote:Thanks for the reply and sorry for the vague questions. Just trying to learn the most I can about jdbcType and javaType as I am thearchitect

Re: When to use jdbcType or javaType

2006-08-03 Thread Nathan Maves
I would suggest that you do use the jdbcType attribute. This always helps with inserting null values into a table. Nathan On Aug 3, 2006, at 3:02 PM, jaybytez wrote: I have been using both jdbcType and javaType everytime when creating a parameterMap or resultMap. Is this necessary? I am

Re: sysdate comparison issue

2006-07-27 Thread Nathan Maves
you can also use the valid html codes like...gt; and lt; NathanOn Jul 25, 2006, at 11:06 PM, Mkhitaryan, Aram wrote:Use this way:   select id="getUserDetails" resultClass="valueObject" parameterClass="valueObject"![CDATA[        SELECT         column1, column2         FROM 

Re: Mapped statement with chained queries ?

2006-07-24 Thread Nathan Maves
On Jul 21, 2006, at 8:50 PM, Fred Janon wrote: Hi Nathan, Which developer guide are you referring to? Version 1 or 2? Data Mapper? I couldn't find anything on pages 36 in any of the guides I have, v1 or 2. Thanks Fred Nathan Maves wrote: Although your solution will work, I would suggest

Re: Mapped statement with chained queries ?

2006-07-21 Thread Nathan Maves
Although your solution will work, I would suggest another.  With your way you run into the classic n+1 problem.  One query to get the tasks, then n number of queries to get the jobs for those tasks.  You get the point.  That is why this is not the preferred way.Try to use the build in group by

Re: using typeHandler tag in sqlMapConfig.xml file

2006-07-11 Thread Nathan Maves
You are using a really old dtd and you need to upgrade it.  Please look at the bottom of the main page at http://ibatis.apache.org/On Jul 11, 2006, at 6:56 AM, chaithanya ibatis wrote:Hi,Can anyone tell me what dtd should i use for using the typeHandler tag in sqlMapConfig.xml filecurrently i'm

Re: IN (SQL), how to iterate?

2006-06-16 Thread Nathan Maves
I would not suggest this method.  You would have to worry about sql injection and the loss of ibatis typing.  I would use the iterate tag.NathanOn Jun 15, 2006, at 10:33 PM, puneet arya wrote:hi,  SELECT name,branch,username               FROM KXAccount               WHERE id IN (#ids#)You can

Re: Enabling Logging

2006-06-11 Thread Nathan Maves
What kind of logging are you looking for from the com.ibatis.* package? Nathan On Jun 11, 2006, at 2:43 PM, Ben Munat wrote: Well, I don't know about Tarek, but I've always used commons- logging with log4j underneath... so both are on my classpath. I've used ibatis on several projects now,

Re: Using non-default timezones

2006-06-05 Thread Nathan Maves
Not sure if this solution will work for you but here is what we use. First off you need to know the TZ of your database. In most cases it will be kept in GMT time. Then you will also have to know what the users current TZ is. At this point you can write something like

Re: Enum Type

2006-05-29 Thread Nathan Maves
Levan, As a first time poster let me inform you on a great source of information. Below is the archive of this alias. Please search there before posting new questions. http://www.mail-archive.com/user-java@ibatis.apache.org/ To answer your post... Yes, This is fully supported in

Re: Order By

2006-05-22 Thread Nathan Maves
use a map as the parametermap.put("orderBy", orderBy");map.put("businessObj", businessObj);Then in the sqlmap...select id="getaTableByAll" resultMap="result" parameterClass="BusClass"select * from aTable where col1 like #businessObj.col1# and col2 like #businessObj,col2# order by

Re: ibatis JSP example?

2006-05-18 Thread Nathan Maves
Michal, The two technologies have nothing to do with each other. iBatis is a framework that can be used anywhere, be that a web application or a standalone application. There is an example web application but it sounds like this might be over your head since the application uses the

Re: Is it possible

2006-05-18 Thread Nathan Maves
A simple way would be to turn on logging and watch if a connection is used.On May 18, 2006, at 1:31 PM, Zacks, Michael wrote: To determine whether query results were returned from the cache or from a trip to the database?  I'm running Ibatis against SqlServer.  My problem is that I have a query

Re: French translation of the SQL Maps for Java Tutorial

2006-05-15 Thread Nathan Maves
Julien, The community would be grateful to have a French version of the manual and developers guides. Nathan On May 15, 2006, at 2:35 AM, Julien Lafontaine wrote: Hi everyone, I am resending this email as it seems that it didn't make it to the mailing list. I have wrote a french

Re: faster updates

2006-05-11 Thread Nathan Maves
of the 1000 are in the batch execute it. This should be way faster then individual updates even with a prepared statement. Nathan On May 10, 2006, at 3:50 PM, netsql wrote: How do you batch update multiples if I discreatley call each update? Do begin trn/end tarn on a timer? .V Nathan Maves wrote

Re: faster updates

2006-05-10 Thread Nathan Maves
First off ibatis uses prepared statements for every query/update. I would suggest trying a batch insert/update first. If this performance is still to slow I would go to a stored procedure. nathan On May 10, 2006, at 3:08 PM, netsql wrote: So I have this application that does this one

Re: I am new to iBatis. Is it possible to insert into multiple tables using one parameter class using iBatis

2006-05-09 Thread Nathan Maves
While some of the drivers might support multiple statements I would suggest against it.I would write this into the DAO level of your code.something likepublic void insertProduct(Product p) {  startTransaction();  executeInstert("insertProduct", p);  for(Service s:p.getServices()) {    

Re: Upgrade Problem iBATIS 1.3.1 - iBATIS 2.1.7

2006-05-03 Thread Nathan Maves
Andre, Some of the methods did change in the 2.x conversion. Can you please post your actual code to the alias so that we can help you better. I would like to see your dao config class. Nathan On May 3, 2006, at 9:09 AM, [EMAIL PROTECTED] wrote: Hello, I have problems updating to

Re: Some problem with the insert tag

2006-05-03 Thread Nathan Maves
This is a common problem.  You need to understand how ibatis maps the properties of an object.  It uses the java bean specification.I would try and change your map to look likeinsert id="getPerson1" parameterClass="com.dwrtest.model.Employee"         insert into Test_Emp        (NAME, EMPNO) 

Re: iBATIS-131 Combatibility JAVA1.5 / tomcat 5.5

2006-04-29 Thread Nathan Maves
migrate to 2.x ? I must evaluate the costs/risks of the migration process. Are there known side-effects ? (We run a Webapplikation using the struts-framework ...) many thanks and greetings, Andre Nathan Maves [EMAIL PROTECTED] .COM

Re: iBATIS-131 Combatibility JAVA1.5 / tomcat 5.5

2006-04-27 Thread Nathan Maves
Andre, iBATIS 2.x is fully compatible with Java 1.5 and Tomcat 5.5. You will also find com/ibatis/db/sqlmap/upgrade/ConvertTask.class, which is that ant task that will convert your maps to the 2.0 syntax and structure. The class is located in lib/1-x-Compatibility/ibatis- sqlmap-1-x.jar

Re: iBATIS-131 Combatibility JAVA1.5 / tomcat 5.5

2006-04-27 Thread Nathan Maves
it to an Integer for you. Generics are not yet supported. On Apr 27, 2006, at 8:34 AM, Nathan Maves wrote: Andre, iBATIS 2.x is fully compatible with Java 1.5 and Tomcat 5.5. You will also find com/ibatis/db/sqlmap/upgrade/ConvertTask.class, which is that ant task that will convert your maps

Re: iBATIS-131 Combatibility JAVA1.5 / tomcat 5.5

2006-04-27 Thread Nathan Maves
Well it appears that I misread your question. The answer is still the same. You can you both 1.x and 2.x with Java 1.5 and Tomcat 5.5 Nathan On Apr 27, 2006, at 8:18 AM, [EMAIL PROTECTED] wrote: Hello, I have a question about iBATIS version 1.3.1. We use it with JDK1.3.1, tomcat 5.0.28

Re: Invalid Column Type issue in confluence

2006-04-21 Thread Nathan Maves
The first option should work fine. Are you positive that it is not one of your other columns causing the issue? Nathan On Apr 20, 2006, at 7:21 PM, Yusuf wrote: Hi, In the faq page about null value inserts in here: http://opensource.atlassian.com/confluence/oss/display/IBATIS/What +cause

Re: multiple setters

2006-03-21 Thread Nathan Maves
Ahhh yeah... not good don't have them. :) They are against the java bean specification. Nathan On Mar 21, 2006, at 4:38 PM, Ben Munat wrote: Hey All... I seem to remember someone talking recently about difficulties with a property set by ibatis having multiple setters. Does this ring a

Re: How to convert BLOB to String.

2006-03-14 Thread Nathan Maves
Yes. All you would have to do is write your own custom type handler. It would do just as Gustavo suggested but you would only have String properties in your POJO. Nathan On Mar 14, 2006, at 8:43 AM, Zsolt wrote: Thank you Gustavo. Is it possible to configure ibatis to put the BLOB

Re: Urgent help required

2006-03-10 Thread Nathan Maves
Just useInteger rows = ((Integer)sqlMap.insert("insertProduct", product)).intValue();if you are using Java 1.5int rows = (Integer)sqlMap.insert("insertProduct", product);NathanOn Mar 10, 2006, at 10:41 AM, Krishnamoorthi, Sruthi (Raytheon) wrote: The docs says     int rows = sqlMap.insert

Re: Urgent help required

2006-03-10 Thread Nathan Maves
ouch the first line should read...int rows = ((Integer)sqlMap.insert("insertProduct", product)).intValue();On Mar 10, 2006, at 10:51 AM, Nathan Maves wrote:Just useInteger rows = ((Integer)sqlMap.insert("insertProduct", product)).intValue();if you are using Java 1.

Re: get the statement

2006-03-09 Thread Nathan Maves
and excuse my english ;) --- Nathan Maves [EMAIL PROTECTED] escribió: The logging will give you all the information that you need. Ex. select * from table where id = #id# The logging will show you the PS select * from table where id = ? And then show you the parameters. You will be able to see

Re: get the statement

2006-03-08 Thread Nathan Maves
Not really sure if you truly want to save the sql or just look at if for debugging purposes. If you are just trying to debug the look at setting up logging for your application. The following page on the wiki should help you set that up.

Re: Resource not found exception

2006-03-02 Thread Nathan Maves
AFAIK there are no issues with the Resources class built into ibatis.  We use it in multiple web applications as well as stand alone java applications.  Of which all of the .properties and .xml files are all included in the jar's.What OS are you working on? I would try to change your path to

Re: Exception error message

2006-02-27 Thread Nathan Maves
Dennis,Letting an exception trickle all the way to your user is generally a bad thing.  If it was me I would catch this exception and then pull the error message from some where else, say a resources file, and the display this to the user.  I have no clue what web framework you are using, if any,

Re: [OT] Need help with SQL Query

2006-02-24 Thread Nathan Maves
You almost had it :) select min(date), min(time), name from mytable where number = 123 group by name Nathan On Feb 24, 2006, at 8:58 AM, Ashish Kulkarni wrote: Hi I have a table with 4 columns number, name, date, time, it is not unique so can have multiple entries for one name at

Re: [OT] Need help with SQL Query

2006-02-24 Thread Nathan Maves
, name from mytable where number = 123 and date = (select min(date) from mytable where number = 123) nathan On Feb 24, 2006, at 9:25 AM, Nathan Maves wrote: You almost had it :) select min(date), min(time), name from mytable where number = 123 group by name Nathan On Feb 24, 2006, at 8

Re: Cache

2006-02-21 Thread Nathan Maves
.atlassian.com/confluence/oss/display/IBATIS/ Frequentl y+Asked+Questions is it in the correct place? Thanks, Yusuf. -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 22, 2006 2:33 AM To: user-java@ibatis.apache.org Subject: Re: Cache I don't think

Re: Cache

2006-02-21 Thread Nathan Maves
?pa geId=3304 Yusuf. -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 22, 2006 11:39 AM To: user-java@ibatis.apache.org Subject: Re: Cache That is the right place but I did not see your post. Let me know if you need help. Nathan On Feb 21

Re: Dynamic addMaps

2006-02-01 Thread Nathan Maves
Can you give us a little more information on your problem? What are you trying to accomplish by using the functionality? Why would you not just define all of your mappings in the sqlMapConfig.xml file? Nathan On Feb 1, 2006, at 6:20 AM, Marcelo Martins wrote: How can i do something like

Re: iBatis and Tomcat

2006-01-30 Thread Nathan Maves
Rashmi,Not sure how you are using the Resources class but this has always worked for us in many many webapps.public class DaoConfig {    private static Log log = LogFactory.getLog(DaoConfig.class);    private static final DaoManager daoManager;    private static final String resource =

Re: iBatis Subquery and Date error

2006-01-26 Thread Nathan Maves
Here are a few things to do that will not solve your problem but will help clean it up.1. Use the insert instead of statement2. Don't specify "remapResults" because you dont have any :)  This option is not available in an insert see item #1To fix your problemuse #name# and #effDate#you are

Re: iBatis Subquery and Date error

2006-01-26 Thread Nathan Maves
Yeah after I sent that I saw that it would not work.What DB are you using?On Jan 26, 2006, at 10:22 AM, Bondre, Prathit wrote:Hi Nathan,Thanks for your response.However the #name# and #effDate# do not work in the select statement and my guess is because in a prepared statement you cannot specify a

Re: iBatis Subquery and Date error

2006-01-26 Thread Nathan Maves
haha that is what I meant to say. Sorry about the confusion. busy day here at the office. On Jan 26, 2006, at 3:03 PM, Michael Campbell wrote: Nathan Maves [EMAIL PROTECTED] writes: Stick with java.sql.Date. Try never to use java.util.Date. Why? The Ibatis datamapper doc (2.0, page 31

Re: junit test

2006-01-24 Thread Nathan Maves
: org.xml.sax.SAXParseException: Attribute namespace is not declared for element sqlMap. Caused by: org.xml.sax.SAXParseException: Attribute namespace is not declared for element sqlMap. -Henry Nathan Maves wrote: Not sure what the issue it since you have not included any error messages but you

Re: [Fwd: ibatis and oracle 7.]

2006-01-24 Thread Nathan Maves
Here is a little bit more info on this issue. The database is run by cards Yes Oracle 7! Notice in the query that we alias the columns... yet in the result set log you only see a few of them. Right now the result class is a HashMap for debugging purposes. Could the JDBC 10g drivers

Re: [Fwd: ibatis and oracle 7.]

2006-01-24 Thread Nathan Maves
I was able to find an forward the classes12.zip file to Diran and that seemed to solve the issues. On Jan 24, 2006, at 1:37 PM, Larry Meadors wrote: Possibly, do you have older drivers to try? Larry On 1/24/06, Nathan Maves [EMAIL PROTECTED] wrote: Could the JDBC 10g drivers be causing

Re: junit test

2006-01-23 Thread Nathan Maves
If you are asking about the JUnit tests for the ibatis code then yes and no :) I have tried it and it will not work. You need to run the unit tests with 1.4. For now the plans looks like we might try to migrate to 1.5 when 1.6 comes out. Don't quote me on this but I would be a good

Re: [OT] Utility to create DDL from a database

2006-01-19 Thread Nathan Maves
Try http://www.minq.se/products/dbvis/ On Jan 19, 2006, at 12:57 PM, Ashish Kulkarni wrote: Hi Is there any open source utility which i can use to create DDL from an existing database, so i can use it to run to create tables on other database. This utility should be smart enough to create DDL

Re: Custom Type Handler problems

2006-01-13 Thread Nathan Maves
You are correct.  This is done by the property type.  AFAIK the type handler is not solely based on the result class.  If you have a class that has nested properties in it then those type will be identified by ibatis and then have a CTH assigned if need be.Some day off in the far future you might

Re: dynamic sql map

2006-01-12 Thread Nathan Maves
You are asking us if your code works? A few things I might change... 1. change your statement tag to a select 2. add a parameter class attribute to the select 3. If you are going to have different numbers of columns selected then you need to set reMapResults = true. This is really the lazy

Re: [Ibatisdb-developer] Re: Escape # in iBATIS

2006-01-12 Thread Nathan Maves
Whoops I sent it to the wrong alias :) On Jan 12, 2006, at 12:40 PM, Nathan Maves wrote: Utkarsh, I have forwarded your email question to the new ibatis alias which is now handled by apache. On Jan 11, 2006, at 7:33 PM, Utkkarsh wrote: Hi Nathan, You do replace it with ## and tha

Re: get Vector as queryForList option

2006-01-11 Thread Nathan Maves
One question... Why do you want a Vector.class object? I have not had any reason in the 5 years to even use one. Nathan On Jan 11, 2006, at 8:08 AM, Ashish Kulkarni wrote: Hi I have defined a query as select id=selectLinesFromView resultClass=java.lang.String SELECT L083LINE FROM PL1083

Re: specify typehandler for byte[]

2006-01-08 Thread Nathan Maves
Andres,I guess I am confused as to what you are trying to do.  Can you give an example of the data?NathanOn Jan 6, 2006, at 7:22 PM, March, Andres wrote:I’m trying to write the bytes to a numeric column not a binary one.  The default one uses setBytes().  I need to do setBigDecimal(). From: [EMAIL

Re: How to deal with a char column in select statement

2006-01-06 Thread Nathan Maves
Trim would be the way to go.  I would also look into fixing your data in the data base.  You could run run a quick sql statement to fix it.update myTable set id = ltrim(rtrim(id));That should remove all leading and trailing white space from you column id.I would also suggest trimming the data

Re: specify typehandler for byte[]

2006-01-06 Thread Nathan Maves
why is the default not good enough for you?On Jan 6, 2006, at 6:51 PM, March, Andres wrote:Well, I learned something new today – the internal representation of class names.  This mapping does not fail like before: typeHandler javaType="[B" jdbcType="NUMERIC"

Re: sql joins in ibatis

2006-01-05 Thread Nathan Maves
Where to start.ClassNotFound is a java error.  You have either misspelled you class name and or package.  Check that you full class name including package is correct.The second problem that I see is in your result map.  You specify dept.name when there is no property named that in your

Re: make DB call for every new connection

2006-01-04 Thread Nathan Maves
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Out of pure curiosity why would you do something like this. What does it buy you? Nathan On Jan 4, 2006, at 6:59 AM, Steven Pannell wrote: Hi, I want to set some session infomation for a connection I make using ibatis on my oracle

Re: How do I resultmap a composite member variable?

2005-12-22 Thread Nathan Maves
It is easier then you think!resultMap id="personmap" class="Person"    result property="SSN" column="ssn"/    result property="name.firstName" column="FNAME"/ result property="name.lastName" column="LNAME"//resultMapI think you have to have have a no argument constructor for you

Re: deleting items in a List

2005-12-21 Thread Nathan Maves
Like most answers this really depends on a lot of different factors. For data integrity I prefer to use a database constraint. Where is gets a little complicated is if you are using caching inside of ibatis. A simple example might be a airline flight with many reservations. If you have

Re: iBatis DTD validation

2005-12-13 Thread Nathan Maves
I have to agree with Larry on this topic.  The real issue is why your parser is not using your local copy of the DTD.  All of the DTD's are in the ibatis jar files.  Look ups via the internet are slow and costly.  Not only are the costly in runtime but in dollar value from the bandwidth that they

Re: iBatis DTD validation

2005-12-13 Thread Nathan Maves
Mark,Everything looks good to me.  There is nothing that you have to do on your part to get the parser to look inside of the jar files.You might want to upgrade your ibatis jars to the newest build. I would stick to 2.1.5 as a production release but there is a newer build then you have.  As you

Re: How to return a List of record?

2005-11-30 Thread Nathan Maves
What you have would work perfectly if you have more then one row in your database that have the same usernm. I am not sure that this is really what you want. If not take out your where clause and you will get a result (java.util.List) of all of your users. Nathan On Nov 30, 2005, at

Re: Dynamic statement

2005-11-14 Thread Nathan Maves
First off by not run well do you mean that there is an error? if so please post it. Second turn on logging to make sure the sql appears as you would expect it to. Third it appears that you are sending in an array of objects as parameters. I would suggest that you use a java bean with

Re: Dynamic statement

2005-11-14 Thread Nathan Maves
w I can get rid of the first OR because any of three fields might have value or no value. Thanks, John Chien Nathan Maves wrote: First off by "not run well"  do you mean that there is an error?  if  so please post it. Second turn on logging to make sure the sql appears as you would

Re: Inserting Default values if object member is null

2005-11-14 Thread Nathan Maves
You can specify your insert sqlmap to use a ParameterMap and set the nullValue property on the specific column.NathanOn Nov 14, 2005, at 11:16 AM, Jason Hall wrote: Hi,   I just want to know if an object member is set to null and the database column is configured as not null, is there a way in

Re: Inserting Default values if object member is null

2005-11-14 Thread Nathan Maves
Whoops wrong attribute.You need to use null="" and not nullValue.This should substitute the given value for any property that is null.NathanOn Nov 14, 2005, at 12:09 PM, Jason Hall wrote: Yah, but the db column is set to not null, so you would get a database error. I've tried that anyhow, and

Re: Inserting Default values if object member is null

2005-11-14 Thread Nathan Maves
BTW you could also do it inlineinsert into A (col1,col2) values (#col1:NUMERIC:-1#, #col2:VARCHAR:NO_ENTRY#This can be found on page 20 of the developers guideOn Nov 14, 2005, at 12:09 PM, Jason Hall wrote: Yah, but the db column is set to not null, so you would get a database error. I've tried

Re: Inserting Default values if object member is null

2005-11-14 Thread Nathan Maves
Well the best bet now would be to initialize the java bean with a default value, i.e. -1. On Nov 14, 2005, at 12:56 PM, Jason Hall wrote: Okay, Just wanted to know, an afilliate of mine wanted to know. Thanks, JH. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

error while using a CTH

2005-10-31 Thread Nathan Maves
Here is the error. com.ibatis.dao.client.DaoException: Error executing query for list. Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in reporting/request/dao/ibatis/mapping/ Requests.xml. --- The error occurred while applying a result map. --- Check the

Re: enums Ibatis

2005-10-28 Thread Nathan Maves
I think this is just what you are looking for. http://opensource2.atlassian.com/confluence/oss/display/IBATIS/How+do +I+use+a+Custom+Type+Handler+with+complex+property+or+Type+Safe +Enumeration Nathan On Oct 28, 2005, at 1:25 PM, [EMAIL PROTECTED] wrote: Are there any good strategies for

<    1   2   3   4   >