You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Larry Meadors <lm...@apache.org> on 2006/02/09 06:20:06 UTC

Re: Very new to ibatis -- help required.

There are 2 things here that jump out as bad ideas:

 1) Using M$ Access for *anything* Java-related
 2) Hijacking another thread and adding your questions to it

So, I would suggest you get either MySQL or PostregreSQL or...well,
almost ANYTHING would be a better choice than Access (except for maybe
FoxPro...that *might* be worse). You need a JDBC driver that doesn't
totally suck, and the JDBC-ODBC bridge does not meet that criteria.

Next, get the User Guide and READ it. At least skim through it, please.

http://ibatis.apache.org/javadownloads.html

Larry


On 2/8/06, jayalakshmi.mohanarangam@wipro.com
<ja...@wipro.com> wrote:
>
>
>
> I am very new to struts and ibatis. I am trying to develop a very small
> application. I just have jsp
> Page (application is developed using struts) which has textbox, which
> gets the id. I want to put the value in the variable id into the
> microsoft access database using ibatis. That's all.
>
> I have downloaded iBATIS_DBL-2.1.7.597 version. I am using jdk1.5.0_06.
> will it be compatible.
> I am working with struts 1.2.7.
>
> I have written two xmls
>  UserForm.xml
>
>   <?xml version="1.0" encoding="ISO-8859-1"?>
>
>
> <!DOCTYPE sqlMap
>   PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN">
>
> <sqlMap namespace="Person">
>
>    <insert id="insertPerson" parameterClass="login.UserForm">
>         INSERT INTO PERSON VALUES(#id#)
>    </insert>
>
> </sqlMap>
>
>
> sqlMap.xml
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <sqlMapConfig>
>
> <transactionManager type="JDBC">
>
> <dataSource type="SIMPLE"
> <property name="JDBC.Driver" value="sun.jdbc.odbc.JdbcOdbcDriver")/>
> <property name="JDBC.ConnectionURL" value="Jdbc:Odbc:dsn"/>
> <property name="JDBC.Username" value="jaya"/>
> <property name="JDBC.Password" value="lakshmi")/>
> </dataSource>
>
> </transactionManger>
>
>
> </sqlMapConfig>
>
>
>
>
>
> I have Person table with id column.
>
> Can anyone tell me where I should extract the ibatis, where should I put
> the person.xml and sqlmap.xml;
>
> Regards,
> Jayalakshmi.
>
>
>
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Yusuf [mailto:Yusuf@ekalife.co.id]
> Sent: Thursday, February 09, 2006 8:40 AM
> To: user-java@ibatis.apache.org
> Subject: RE: Different Number of Columns in resultClass with xml and
> with HashMap
>
> Hello, regarding my last question, let me simplify this question:
> I have a resultMap that contains another select statement that populates
> one of the column, If the resultMap contains 10 column, which 2 of them
> contains another select statement, then this is what happens:
>         - if i map the results to a Map or a class, then the result is
> correct (10 columns)
>         - if i use resultMap="xml", then the result is only 8 columns
> (without the 2 which contains another select)
>
> have anyone experienced this before? or a bug?
>
> Thanks,
> Yusuf.
>
> -----Original Message-----
> From: Yusuf
> Sent: Tuesday, February 07, 2006 2:02 PM
> To: user-java@ibatis.apache.org
> Subject: Different Number of Columns in resultClass with xml and with
> HashMap
>
>
> Hi,
> I have a working query and the resultmap is like this:
>
> <resultMap id="resultParent" class="java.util.HashMap">
>         <result property="NAMA_PP" column="NAMA_PP" javaType="string"
> jdbcType="VARCHAR2" nullValue=""/>
>         <result property="BEGDATE" column="BEGDATE" javaType="string"
> jdbcType="VARCHAR2" nullValue=""/>
>         <result property="ENDDATE" column="ENDDATE" javaType="string"
> jdbcType="VARCHAR2" nullValue=""/>
>         <result property="SAR_POLIS" column="{spaj=REG_SPAJ,
> tahunKe=TAHUN_KE}" javaType="double" jdbcType="NUMBER" nullValue="0"
> select="selectChild1"/>
>         <result property="MSPR_PREMIUM" column="MSPR_PREMIUM"
> javaType="double" jdbcType="NUMBER" nullValue="0"/>
>
>         <result property="PREMI_RIDER" column="REG_SPAJ"
> javaType="double" jdbcType="NUMBER" nullValue="0"
> select="selectChild2"/>
>         <result property="PREMI_EXTRA" column="REG_SPAJ"
> javaType="double" jdbcType="NUMBER" nullValue="0"
> select="selectChild3"/>
> </resultMap>
>
> So far there is no problem (all the inner fields also populated with the
> selectChild1, selectChild2, ..),
> but when i tried changing the resultMap class to xml like this:
>
> <resultMap id="resultParent" class="xml">
>         <result property="NAMA_PP" column="NAMA_PP" javaType="string"
> jdbcType="VARCHAR2" nullValue=""/>
>         <result property="BEGDATE" column="BEGDATE" javaType="string"
> jdbcType="VARCHAR2" nullValue=""/>
>         <result property="ENDDATE" column="ENDDATE" javaType="string"
> jdbcType="VARCHAR2" nullValue=""/>
>         <result property="SAR_POLIS" column="{spaj=REG_SPAJ,
> tahunKe=TAHUN_KE}" javaType="double" jdbcType="NUMBER" nullValue="0"
> select="selectChild1"/>
>         <result property="MSPR_PREMIUM" column="MSPR_PREMIUM"
> javaType="double" jdbcType="NUMBER" nullValue="0"/>
>
>         <result property="PREMI_RIDER" column="REG_SPAJ"
> javaType="double" jdbcType="NUMBER" nullValue="0"
> select="selectChild2"/>
>         <result property="PREMI_EXTRA" column="REG_SPAJ"
> javaType="double" jdbcType="NUMBER" nullValue="0"
> select="selectChild3"/>
> </resultMap>
>
> and used a custom type handler to process the xml like this (i'm using
> dom4j):
>
> static class XmlRowHandler implements RowHandler {
>         private Document domDocument;
>         public XmlRowHandler(String xmlResultName) {
>                 domDocument = DocumentHelper.createDocument();
>                 getDomDocument().addElement(xmlResultName);
>         }
>         public void handleRow(Object object) {
>                 try {
>                         Document xmlFragment = DocumentHelper
>                                         .parseText((String) object);
>                         Element xmlElement =
> xmlFragment.getRootElement();
>
> getDomDocument().getRootElement().add(xmlElement);
>                 } catch (DocumentException e) {
>                 }
>         }
>         public Document getDomDocument() {
>                 return domDocument;
>         }
> }
>
> private Document queryXml(String queryId, Object param) {
>         RowHandler rowHandler = new XmlRowHandler("result");
>         getSqlMapClientTemplate().queryWithRowHandler(queryId, param,
> rowHandler);
>         Document doc = ((XmlRowHandler) rowHandler).getDomDocument();
>         return doc;
> }
>
> the result is different. Only the columns without inner selects are
> shown, so instead of having 7 columns per row, there is only 4 columns
> per row. I have used this custom xml handler for other queries and it
> ran well.
>
> Is this a bug in ibatis, or I've done something wrong?
>
> Thank you for your help and regards,
> Yusuf S.
>
>
>
>
> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
>
> www.wipro.com
>

Re: ibastis mapping performance

Posted by Clinton Begin <cl...@gmail.com>.
Or, you can link your IDE to the include iBATIS source code and step through
it to find out what is taking the time.

Cheers,
Clinton

On 2/9/06, Brandon Goodin <br...@gmail.com> wrote:
>
> I would recommend that you provide more detail on your situation.
> Statements like "mapping is taking quite a long time for us" do not
> provide us information that we can use to assist you. iBatis has been
> very performant for many users. So, if you can provide us with
> information on how you are using iBatis we will likely be able to
> identify where you are using iBatis incorrectly. I can assure you that
> it should not take a long time.
>
> Brandon
>
> On 2/9/06, a b <eo...@yahoo.com> wrote:
> > the mapping is taking quite a long time for us that's
> > why i'm asking the question, just wondering has anyone
> > else encountered a similar problem
> >
> > --- Clinton Begin <cl...@gmail.com> wrote:
> >
> > > Hmm...I'll need to set up a template with a canned
> > > answer for this.
> > >
> > > Generic benchmarks are useless.  You'll get full
> > > agreement from any open
> > > source team (like Hibernate), and you may get a
> > > mixed response from
> > > commercial vendors like oracle.
> > >
> > > The only benchmarks and tests that matter are those
> > > that you do in your own
> > > environment that adequately represent your needs.
> > >
> > > Cheers,
> > > Clinton
> > >
> > >
> > > On 2/9/06, Brandon Goodin <br...@gmail.com>
> > > wrote:
> > > >
> > > > I am not aware of a comprehensive comparison of
> > > ORM frameworks.
> > > > However, iBatis would likely not be a part of
> > > that. We are not an
> > > > Object-Relational-Mapping framework. We are SQL
> > > Mapping framework and
> > > > value based. Not Table and Object ID based like
> > > ORM. That said... you
> > > > WOULD be able to categorize us correctly as a
> > > "persistence" framework.
> > > >
> > > > Also, in what case would you be returning a
> > > million objects in a java
> > > > application?
> > > >
> > > > On 2/8/06, a b <eo...@yahoo.com> wrote:
> > > > > hi, is there articles that compare the orm
> > > mappers out
> > > > > there for mapping performance? i.e. after i get
> > > a
> > > > > query result how long does it take to generate
> > > the
> > > > > object, and what if the resultset is like a
> > > million of
> > > > > records
> > > > >
> > > > > thanks
> > > > >
> > > > >
> > > > >
> > > __________________________________________________
> > > > > Do You Yahoo!?
> > > > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around
> > > > > http://mail.yahoo.com
> > > > >
> > > >
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
>

Re: ibastis mapping performance

Posted by Brandon Goodin <br...@gmail.com>.
I would recommend that you provide more detail on your situation.
Statements like "mapping is taking quite a long time for us" do not
provide us information that we can use to assist you. iBatis has been
very performant for many users. So, if you can provide us with
information on how you are using iBatis we will likely be able to
identify where you are using iBatis incorrectly. I can assure you that
it should not take a long time.

Brandon

On 2/9/06, a b <eo...@yahoo.com> wrote:
> the mapping is taking quite a long time for us that's
> why i'm asking the question, just wondering has anyone
> else encountered a similar problem
>
> --- Clinton Begin <cl...@gmail.com> wrote:
>
> > Hmm...I'll need to set up a template with a canned
> > answer for this.
> >
> > Generic benchmarks are useless.  You'll get full
> > agreement from any open
> > source team (like Hibernate), and you may get a
> > mixed response from
> > commercial vendors like oracle.
> >
> > The only benchmarks and tests that matter are those
> > that you do in your own
> > environment that adequately represent your needs.
> >
> > Cheers,
> > Clinton
> >
> >
> > On 2/9/06, Brandon Goodin <br...@gmail.com>
> > wrote:
> > >
> > > I am not aware of a comprehensive comparison of
> > ORM frameworks.
> > > However, iBatis would likely not be a part of
> > that. We are not an
> > > Object-Relational-Mapping framework. We are SQL
> > Mapping framework and
> > > value based. Not Table and Object ID based like
> > ORM. That said... you
> > > WOULD be able to categorize us correctly as a
> > "persistence" framework.
> > >
> > > Also, in what case would you be returning a
> > million objects in a java
> > > application?
> > >
> > > On 2/8/06, a b <eo...@yahoo.com> wrote:
> > > > hi, is there articles that compare the orm
> > mappers out
> > > > there for mapping performance? i.e. after i get
> > a
> > > > query result how long does it take to generate
> > the
> > > > object, and what if the resultset is like a
> > million of
> > > > records
> > > >
> > > > thanks
> > > >
> > > >
> > > >
> > __________________________________________________
> > > > Do You Yahoo!?
> > > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > > > http://mail.yahoo.com
> > > >
> > >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>

Re: ibastis mapping performance

Posted by a b <eo...@yahoo.com>.
the mapping is taking quite a long time for us that's
why i'm asking the question, just wondering has anyone
else encountered a similar problem

--- Clinton Begin <cl...@gmail.com> wrote:

> Hmm...I'll need to set up a template with a canned
> answer for this.
> 
> Generic benchmarks are useless.  You'll get full
> agreement from any open
> source team (like Hibernate), and you may get a
> mixed response from
> commercial vendors like oracle.
> 
> The only benchmarks and tests that matter are those
> that you do in your own
> environment that adequately represent your needs.
> 
> Cheers,
> Clinton
> 
> 
> On 2/9/06, Brandon Goodin <br...@gmail.com>
> wrote:
> >
> > I am not aware of a comprehensive comparison of
> ORM frameworks.
> > However, iBatis would likely not be a part of
> that. We are not an
> > Object-Relational-Mapping framework. We are SQL
> Mapping framework and
> > value based. Not Table and Object ID based like
> ORM. That said... you
> > WOULD be able to categorize us correctly as a
> "persistence" framework.
> >
> > Also, in what case would you be returning a
> million objects in a java
> > application?
> >
> > On 2/8/06, a b <eo...@yahoo.com> wrote:
> > > hi, is there articles that compare the orm
> mappers out
> > > there for mapping performance? i.e. after i get
> a
> > > query result how long does it take to generate
> the
> > > object, and what if the resultset is like a
> million of
> > > records
> > >
> > > thanks
> > >
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > > http://mail.yahoo.com
> > >
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: ibastis mapping performance

Posted by Clinton Begin <cl...@gmail.com>.
Hmm...I'll need to set up a template with a canned answer for this.

Generic benchmarks are useless.  You'll get full agreement from any open
source team (like Hibernate), and you may get a mixed response from
commercial vendors like oracle.

The only benchmarks and tests that matter are those that you do in your own
environment that adequately represent your needs.

Cheers,
Clinton


On 2/9/06, Brandon Goodin <br...@gmail.com> wrote:
>
> I am not aware of a comprehensive comparison of ORM frameworks.
> However, iBatis would likely not be a part of that. We are not an
> Object-Relational-Mapping framework. We are SQL Mapping framework and
> value based. Not Table and Object ID based like ORM. That said... you
> WOULD be able to categorize us correctly as a "persistence" framework.
>
> Also, in what case would you be returning a million objects in a java
> application?
>
> On 2/8/06, a b <eo...@yahoo.com> wrote:
> > hi, is there articles that compare the orm mappers out
> > there for mapping performance? i.e. after i get a
> > query result how long does it take to generate the
> > object, and what if the resultset is like a million of
> > records
> >
> > thanks
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
>

Re: ibastis mapping performance

Posted by Brandon Goodin <br...@gmail.com>.
I am not aware of a comprehensive comparison of ORM frameworks.
However, iBatis would likely not be a part of that. We are not an
Object-Relational-Mapping framework. We are SQL Mapping framework and
value based. Not Table and Object ID based like ORM. That said... you
WOULD be able to categorize us correctly as a "persistence" framework.

Also, in what case would you be returning a million objects in a java
application?

On 2/8/06, a b <eo...@yahoo.com> wrote:
> hi, is there articles that compare the orm mappers out
> there for mapping performance? i.e. after i get a
> query result how long does it take to generate the
> object, and what if the resultset is like a million of
> records
>
> thanks
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>

ibastis mapping performance

Posted by a b <eo...@yahoo.com>.
hi, is there articles that compare the orm mappers out
there for mapping performance? i.e. after i get a
query result how long does it take to generate the
object, and what if the resultset is like a million of
records

thanks


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com