Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.CARNet.hr!gregory.BNet.hr!not-for-mail From: Josip Almasi Newsgroups: comp.lang.java.programmer Subject: Re: Hibernate query - field length, pulling wrong record Date: Fri, 25 Apr 2014 10:44:48 +0200 Organization: B.net Hrvatska d.o.o. Lines: 18 Message-ID: References: NNTP-Posting-Host: cpe-94-253-179-22.zg.cable.xnet.hr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: gregory.bnet.hr 1398415489 13778 94.253.179.22 (25 Apr 2014 08:44:49 GMT) X-Complaints-To: abuse@globalnet.hr NNTP-Posting-Date: Fri, 25 Apr 2014 08:44:49 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:28223 On 04/24/2014 09:07 PM, getdgbmail@gmail.com wrote: > I am using a Hibernate query in JAVA to retrieve data from an iSeries file. > The field length of fieldName in my query WHERE clause is 4 long. There is a > record in the file with a field name of BLUE. When I run the query using > BLUE_GREEN, this record is selected. BLUE_GREEN is not BLUE, so I don't want > this field to be selected. Why is this happening? > > > > WHERE > fieldName = :fieldName > AFAIK hibernate does not truncate strings to field lengths. It may be doing of either jdbc driver or database. Guess you should start by googling 'iseries jdbc truncate':) Regards...