Return-Path: Mailing-List: contact ibatis-user-java-help@incubator.apache.org; run by ezmlm Delivered-To: mailing list ibatis-user-java@incubator.apache.org Received: (qmail 28580 invoked by uid 99); 23 Dec 2004 17:26:32 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of clinton.begin@gmail.com designates 64.233.184.206 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.206) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 23 Dec 2004 09:26:29 -0800 Received: by wproxy.gmail.com with SMTP id 71so118011wri for ; Thu, 23 Dec 2004 09:26:27 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=gkBjJIA2hpPNABlq0lNg/yLcRLFK+lIB8cohlD6eW8QC0rHvUT+LJiDOOm7Zy5Hd/hK2hVQioaMW+Sw4HVs50xV4JyXh4aj8hRcWMp8AEz4zooYAFRNi64WoW2YYkI9kZEg8/cNQqdSN4A/C19MaccJjU9/6afJ4mYrLfldgDrM= Received: by 10.54.5.11 with SMTP id 11mr111118wre; Thu, 23 Dec 2004 09:26:27 -0800 (PST) Received: by 10.54.33.38 with HTTP; Thu, 23 Dec 2004 09:26:27 -0800 (PST) Message-ID: <16178eb104122309261356453b@mail.gmail.com> Date: Thu, 23 Dec 2004 10:26:27 -0700 From: Clinton Begin Reply-To: cbegin@ibatis.com To: gus wang Subject: Re: does ibatis support oracle cursor Cc: ibatis-user-java@incubator.apache.org In-Reply-To: <41CABB9C.4060800@sun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <16178eb10412122059391d842b@mail.gmail.com> <41CABB9C.4060800@sun.com> X-Virus-Checked: Checked Gus, I didn't realize you were trying to do this through an OUT parameter. Unfortunately custom type handlers don't yet work with output parameters. You might be better off just using straight JDBC for this one....as is often the case with vendor specific APIs. Cheers, Clinton On Thu, 23 Dec 2004 20:35:40 +0800, gus wang wrote: > Dear Clinton, > > I would really appreciate you going one step further to help out. How > can I do the equivalent of > > aCallableStatement.registerOutParameter(4,oracle.jdbc.OracleTypes.CURSOR ) in iBatis when it is a stored procedure??? > > > > > > > > > > > begin > eoffice.GetDocManager(?,?,?,?); > end; > ]]> > > > --------------------------- in jdbc, it would have been > ------------------------------------- > > java.sql.Connection conn = null; > java.sql.CallableStatement cstmt = null; > java.sql.ResultSet rs = null; > > try { > conn = getConnection(); > String sql = "{call eoffice.GetDocManager(?,?,?,?)}"; > > cstmt = conn.prepareCall(sql); > cstmt.setString(1,compId); > cstmt.setString(2,docType); > cstmt.setString(3,flag); > cstmt.registerOutParameter(4,oracle.jdbc.OracleTypes.CURSOR ); > cstmt.executeQuery(); > > rs = (java.sql.ResultSet)cstmt.getObject(4); > > > Clinton Begin wrote: > > >Not directly, as it's a database specific type. You can create a > >custom type handler and use ResultSet getObject() to get the cursor. > >You must use the cursor completely within the type handler, as all > >resources are closed by the end of the execution. > > > >Clinton > > > > > >On Thu, 09 Dec 2004 15:11:32 +0800, Gus Wang wrote: > > > > > >>Hi, > >> > >>Does iBatis have support for Oracle stored procedure when the return > >>is a cursor (resultset)? How if yes? In JDBC, this is supported thru > >>oracle.jdbc.OracleTypes.CURSOR? Thanks in advance! > >> > >>Gus Wang > >>13570700773 > >>Java Architect > >>Enterprise Web Services > >>Sun > >> > >> > >> > > -- > Gus Wang > 13570700773 > Senior Solution Architect > Enterprise Web Services > CSO, Sun China > >