iBATIS DataMapper
March 2010  
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

  2009/09/03

how config batch insert on sqlmap?

Posted at 03 Sep @ 4:46 AM by jones_ahk | 0 comments
  2008/09/18

when i attempt the operation listed belowed on weblogic 8.1,exception occured,i think this is due to the jdk version(jdk 1.4 for weblogic 8.1)
com/ibatis/sqlmap/engine/transaction/ext
ernal/ExternalTransactionConfig (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
3)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.class$(SqlMapC
lientFactoryBean.java:84)

thank U

Posted at 18 Sep @ 9:09 AM by wang yong | 0 comments
  2007/05/30

Hi All,

I am new in iBatis.

1. Shall we defined multiple Database Connection in SqlMapConfig.xml.

2. Shall we access multiple DB in iBatis (like Oracle,Mysql) . Is it possible?

I don't have iBatis related Tutorial.

Pleae send me and help me also.

My Mail id: manokaran.d@polaris.co.in.

Thanks and Regards,
Manokaran.D

Posted at 30 May @ 5:52 AM by manokaran.d | 0 comments
  2007/05/10

good morning~!
I have a problem.In oracle,i want to get the resultset count , i used resultset.last() and resultset.getrownum().
But the resultset is transfer by network and stored in my local machine.
If the resultset is big,the time will lost more.
How can i set the preference and make the resultset.last() don't transfer by network. thanks~!

Posted at 10 May @ 8:32 PM by lance | 0 comments
  2007/02/25

IBatisNetGen generates IBatisNet SQL mapping file and a group CSharp classes from a database table.

Output for each database table:
Entity, the C# class that represents a database record.
DaoIntf, the C# DAO interface contains a group of data manipulation methods, such as:
GetCount, gets the count of all records.
FindAll, loads all database records.
Find, loads a database record using primary key value(s).
FindByXXX, loads a group of records by the value of a column.
Delete, deletes a database record.
DeleteByXXX, deletes a group of records of by the value of a column.
Update, updates a database record.
DaoImpl, the C# DAO implementation class that implements the interface referred by DaoIntf.
DataMaps, the IBatis.NET SQL mapping file that contains SQL statements used in the DaoImpl above.

http://www.cnblogs.com/smartkid/archive/2007/02/22/653828.html

Posted at 25 Feb @ 2:36 AM by smartkid | 0 comments
  2007/01/17

Hi!

I'm developing a web app with ibatis (2.2) and have got a problem with complex properties and passing substitution strings parameter for sql query of properties.

For example:

<sqlMap namespace="user">
<resultMap id="User" class="bean.User">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="address" column="id" select="getAddress"/>
</resultMap>

<select id="getUser" parameterClass="int" resultMap="User">
SELECT id,name FROM $schema$.tbl_user WHERE id = #value#
</select>

<select id="getAddress" parameterClass="int" resultClass="string">
SELECT address FROM $schema$.tbl_address WHERE id = #value#
</select>
</sqlMap>

Here, bean.User class has the following properties:
private String schema;
private int id;
private String name;
so, I only passed schema parameter for getUser sql, but I couldn't pass it for getAddress sql.
Please help me to solve this problem. You can contact me by email address: hoanntbkit@yahoo.com
Thank you very much!

Posted at 17 Jan @ 7:40 PM by Nguyen Hoan | 0 comments
  2006/10/29

This implementation of JavaModelGenerator allows class creation through Velocity's templates.

advantage:

  • templates are externals to Java code
  • easy to modify existing methods of created classes
  • easy to add extra methods of created classes (for example equals,hashCode, toString ...)
  • allows personalization of single created class

disadvantage:

  • Velocity know-how ( it's easy )

More info in my WEB space

Posted at 29 Oct @ 3:16 AM by Gian Marco | 0 comments
  2006/08/17

In some databases like ORACLE,
queries executed from iBatis (maybe because of the jdbc driver?) with WHERE clauses involving CHAR columns, will have zero results, for example :

EMPNO ENAME JOB
7369 SMITH CLERK
7499 ALLEN SALESMAN
7521 WARD SALESMAN
7566 JONES MANAGER
7654 MARTIN SALESMAN
7698 BLAKE MANAGER
7782 CLARK MANAGER
7788 SCOTT ANALYST

created using this script :

CREATE TABLE EMP (
        EMPNO NUMBER(4) NOT NULL,
        ENAME CHAR(10),
        JOB VARCHAR2(9)
        )
        

and we tried to query :

SELECT * FROM EMP WHERE ENAME='JONES'
        

will results in 0 records, although there should be 1 result.

This is because unlike VARCHAR, CHAR(10) is always treated 10 characters per string, so a workaround for this issue is to query like this

SELECT * FROM EMP WHERE ENAME=rpad('JONES',10,' ')
        
Posted at 17 Aug @ 9:58 PM by Yusuf Sutarko | 2 comments
  2006/06/18

Hi!
How can i insert large BLOB in an Oracle's db using iBatis?
I'm using Oracle 9i and ojdbc14.jar.
With small BLOB, it works fine, but with big, i get this error:

— The error occurred while applying a parameter map.
— Check the AtkMessaggio.insert-params.
— Check the parameter mapping for the 'contenuto' property.
— Cause: java.sql.SQLException: Data size bigger than max size for
this type: 5650
Caused by: java.sql.SQLException: Data size bigger than max size for
this type: 5650
at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:86)
...

and

I've migrated from mySQL to Oracle and am having a problem reading a byte array that I have stored as a BLOB in Oracle. With mySQL the byte array was returned as I wanted, but with Oracle something strange is happening.
I'm using iBATIS to access the database. From some googling I've done I think that the byte array I am getting from Oracle is a representation of the BLOB rather than the data that I have stored in it. Any ideas how I can get my byte array back?

Any help greatly appreciated,
Cheers,
cxz.

Posted at 18 Jun @ 1:52 AM by goodcui | 0 comments
  2006/03/31

i'm trying to exceute two different queries in one shot.

 

which are

insert into employee (id, name, address) values (#id#, #name#, #address#);

update employeestate set totalemployees = totalemployees + 1;

 

i used <statement> tag but it dosent work.

Posted at 31 Mar @ 8:11 AM by Alex Han | 0 comments
  2006/02/21

Apparently, iBATIS doesn't enable caching by default (although in the SqlMaps documentation said it's enabled by default)

Here's what you need to do:

  • Open your SqlMapConfig.xml file and add cacheModelsEnabled="true" in the <settings> tag, for example:

            <settings
                cacheModelsEnabled="true"
                ...
            />

Posted at 21 Feb @ 7:45 PM by Yusuf Sutarko | 0 comments
  2005/12/27

Hi i am using this parameterMap

<parameterMap id="licenciaParametros" class="map">
<parameter property="fechaInicio" jdbcType="Date" javaType="java.util.Date" mode="IN"/>
<parameter property="fechaFin" jdbcType="Date" javaType="java.util.Date" mode="IN"/>
<parameter property="IdtipoServicio" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
<parameter property="Idcentro" jdbcType="INTEGER" javaType="java.lang.Integer" mode="IN"/>
<parameter property="Idclase" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
<parameter property="Idcategoria" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
</parameterMap>

and i am getting an exception
aused by: com.ibatis.dao.client.DaoException: Failed to queryForList - id [PLCT_LICENCIA.LISTAR_NUEVAS_LICENCIAS], parameterObject [

Unknown macro: {Idcentro=1, fechaFin=Tue Dec 27 09}
]. Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
— The error occurred in gob/pe/mtc/siict/dat/licencias/ibatis/sqlmapdao/sql/PLCT_LICENCIA.xml.
— The error occurred while applying a parameter map.
— Check the Licencia.licenciaParametros.
— Check the parameter mapping for the 'fechaInicio' property.
— Cause: java.sql.SQLException: Índice de columna no válido
Caused by: java.sql.SQLException: Índice de columna no válido
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
— The error occurred in gob/pe/mtc/siict/dat/licencias/ibatis/sqlmapdao/sql/PLCT_LICENCIA.xml.
— The error occurred while applying a parameter map.
— Check the Licencia.licenciaParametros.
— Check the parameter mapping for the 'fechaInicio' property.
— Cause: java.sql.SQLException: Índice de columna no válido
Caused by: java.sql.SQLException: Índice de columna no válido

i suppose it is the mapping but i dont know what is wrong any help will be welcome

Posted at 27 Dec @ 8:26 AM by Fishel Gonzalez Berenstein | 0 comments
  2005/11/28
Last changed: Nov 28, 2005 23:06 by zcjsh

CREATE OR REPLACE PACKAGE "JAMES"."PKG_TEST" as
TYPE myrctype IS REF CURSOR;
end pkg_test;

CREATE OR REPLACE PROCEDURE "JAMES"."PRO_DKTPHOUSEPLANBACKTEST"
(
p_rc out pkg_test.myrctype
)
as

begin
open p_rc for select LOANMODEID,way,isvisible,isdelete from dkLOANMODE;
end;

<parameterMap id="swapParas" class="map">
<parameter property="p_rc" jdbcType="" javaType="" mode="OUT" />
</parameterMap>
<procedure id="PhouseLoan.queryTphousePlanBack" parameterMap="swapParas">

Unknown macro: {call PRO_DKTPHOUSEPLANBACKTEST(?)}

</procedure>

this pro_dkTphousePlanBack return cursor,

in .java
HashMap paraMap = new HashMap();
paraMap.put("p_rc", null);
queryForObject("PhouseLoan.queryTphousePlanBack",paraMap);
with Input parameter

Posted at 28 Nov @ 11:01 PM by zcjsh | 0 comments
  2005/10/21

Akcess(www.akcess.in) has released Krish Magic(Convert Classes to Database) version 1.0, a powerful Windows free tool that makes database creation quick and easy. This tool helps to convert java classes, which can be generated from UML class diagram or can be written manually, to DDL script.
Please visit our website for more information

www.akcess.in

Posted at 21 Oct @ 4:20 PM by Mike | 0 comments
Site running on a free Atlassian Confluence Open Source Project License granted to OSS. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.5 Build:#811 Jul 25, 2007) - Bug/feature request - Contact Administrators