X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B5062539E5 for ; Thu, 14 Apr 2005 21:34:03 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 88910-04 for ; Fri, 15 Apr 2005 00:33:57 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id DDDE0539D4 for ; Thu, 14 Apr 2005 21:33:55 -0300 (ADT) Received: (qmail 27935 invoked from network); 15 Apr 2005 00:32:33 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 15 Apr 2005 00:32:33 -0000 Message-ID: <425F0BE9.60708@fastcrypt.com> Date: Thu, 14 Apr 2005 20:33:45 -0400 From: Dave Cramer Reply-To: pg@fastcrypt.com Organization: Postgres International User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Vernon Cc: pgsql-jdbc@postgresql.org Subject: Re: Error with a hibernate query References: <20050415001606.11426.qmail@web40502.mail.yahoo.com> In-Reply-To: <20050415001606.11426.qmail@web40502.mail.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.03 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/89 X-Sequence-Number: 12696 Do you have a hibernate mapping file ? Dave Vernon wrote: >The Java code: > >public class User { > > private Long id; > private String username; > private String password; > > //... >} > >The DB table: > >create table USERS ( > id SERIAL UNIQUE primary key, > username VARCHAR(80) NOT NULL, > password VARCHAR(80) NOT NULL, > ... >); > >The Hibernate query: > >getHibernateTemplate().findByNamedParam("select u from > User as u where u.username=:username and >u.password=:password", new String[] { "username", >"password" } > >>From the stack, the following error seems to be on the >JDBC driver side. Any suggestions of solving this >problem? > > >org.springframework.jdbc.BadSqlGrammarException: Bad >SQL grammar [] in task 'Hibernate operation'; nested >exception is java.sql.SQLException: ERROR: operator >does not exist: character varying = bytea >java.sql.SQLException: ERROR: operator does not exist: >character varying = bytea > at >org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1365) > at >org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1160) > at >org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:172) > at >org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:387) > at >org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:328) > at >org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:238) > at >org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92) > at >net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:88) > at >net.sf.hibernate.loader.Loader.getResultSet(Loader.java:875) > at >net.sf.hibernate.loader.Loader.doQuery(Loader.java:269) > at >net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133) > at >net.sf.hibernate.loader.Loader.doList(Loader.java:1033) > at >net.sf.hibernate.loader.Loader.list(Loader.java:1024) > at >net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854) > at >net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1553) > at >net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39) > at > > > >__________________________________ >Do you Yahoo!? >Yahoo! Small Business - Try our new resources site! >http://smallbusiness.yahoo.com/resources/ > >---------------------------(end of broadcast)--------------------------- >TIP 4: Don't 'kill -9' the postmaster > > > > -- Dave Cramer http://www.postgresintl.com 519 939 0336 ICQ#14675561