Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 98574 invoked from network); 13 Dec 2006 15:01:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Dec 2006 15:01:33 -0000 Received: (qmail 58795 invoked by uid 500); 13 Dec 2006 15:01:40 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 58688 invoked by uid 500); 13 Dec 2006 15:01:39 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 58595 invoked by uid 99); 13 Dec 2006 15:01:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Dec 2006 07:01:39 -0800 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [168.166.59.193] (HELO oscln0005.courts.state.mo.us) (168.166.59.193) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Dec 2006 07:01:29 -0800 Received: from (oscln0005.courts.state.mo.us [10.100.1.37]) by OSCNM0006.courts.state.mo.us with smtp id 2dcd_924f1cfc_8abb_11db_913d_0002b3e8d4f3; Wed, 13 Dec 2006 09:06:55 -0600 Subject: spring newbie having problems using ibatis with spring dao To: user-java@ibatis.apache.org X-Mailer: Lotus Notes Release 7.0.1 January 17, 2006 Message-ID: From: Cory.Bestgen@courts.mo.gov Date: Wed, 13 Dec 2006 09:03:21 -0600 X-MIMETrack: Serialize by Router on OSCLN0005/OSCA/Courts/Judicial(Release 7.0.1 HF283|June 29, 2006) at 12/13/2006 09:03:39 AM MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org Hi, I noticed that the website now recommends using the spring dao framework instead of the ibatis one. I have never used spring before and decided to try a little test to see how to get the spring dao framework up and running with ibatis. I am using spring 2.01 and have tried ibatis 2.1.7.597, 2.2.0.638 and 2.3.0.677 but still get the following error. According to the log it looks like an ">" is getting inserted into my sql statement somewhere in the process. Is there something in my spring files that is causing this? Any ideas? Thanks, Cory . error - 2006-12-13 08:38:40,551 INFO [org.springframework.core.CollectionFactory] - 2006-12-13 08:38:40,598 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - 2006-12-13 08:38:41,804 DEBUG [java.sql.Connection] - <{conn-100000} Connection> 2006-12-13 08:38:42,039 DEBUG [java.sql.PreparedStatement] - <{pstm-100001} PreparedStatement: SELECT * FROM OTOT_JOB_SCHEDULE > 2006-12-13 08:38:42,039 DEBUG [java.sql.PreparedStatement] - <{pstm-100001} Parameters: []> 2006-12-13 08:38:42,039 DEBUG [java.sql.PreparedStatement] - <{pstm-100001} Types: []> 2006-12-13 08:38:42,071 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - 2006-12-13 08:38:42,180 INFO [org.springframework.jdbc.support.SQLErrorCodesFactory] - Exception in thread "main" org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in test/OtotJobSchedule.xml. --- The error occurred while applying a parameter map. --- Check the OtotJobSchedule.getAll-InlineParameterMap. --- Check the statement (query failed). --- Cause: java.sql.SQLException: ORA-00942: table or view does not exist beans.xml - sql-map-config.xml - OtotJobSchedule.xml - Main.java - import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.util.Iterator; import java.util.List; import javax.sql.DataSource; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.core.io.ClassPathResource; import test.OtotJobSchedule; import test.OtotJobScheduleDao; public class Main { public static void main(String[] args) { ClassPathResource resource = new ClassPathResource("beans.xml"); BeanFactory beanFactory = new XmlBeanFactory(resource); OtotJobScheduleDao ototJobScheduleDao = (OtotJobScheduleDao) beanFactory .getBean("ototJobScheduleDao"); List list = ototJobScheduleDao.getAll(); for (Iterator iterator = list.iterator(); iterator.hasNext();) { OtotJobSchedule ototJobSchedule = (OtotJobSchedule) iterator.next(); System.out.println(ototJobSchedule.getId() + ":" + ototJobSchedule.getDescription() + ":" + ototJobSchedule.getJobType()); } } } Cory Bestgen Information Technology Division Office of State Courts Administrator (573) 522 - 5455 cory.bestgen@courts.mo.gov