strange jdbc problem moving to 8.1 database - Mailing list pgsql-jdbc

From kevin@mtel.co.uk
Subject strange jdbc problem moving to 8.1 database
Date
Msg-id 1131745257.306929.168940@g14g2000cwa.googlegroups.com
Whole thread Raw
Responses Re: strange jdbc problem moving to 8.1 database
List pgsql-jdbc
hi, i've got a test system under fedora 4/ 8.04 postgres that works
fine. I installed 8.1 on a production machine using redhat 9, and weird
errors start happening.

here's the java sql code

      String strSQL = "SELECT mi.menuitemid " +
                      "  FROM menuitem mi"+
                      " INNER JOIN menuitemtypes mit" +
                      "    ON (mi.menuitemid = mit.menuitemid) " +
                      " INNER JOIN menugroupitem mgi " +
                      "    ON (mgi.menuitemid = mit.menuitemid) " +
                      " WHERE mit.usertype = ? " +
                      "   AND mgi.menugroupid = ? " +
                      "   AND mi.menuitemid = ? ";

      pstmt = livedb.prepareStatement(strSQL);
      pstmt.setString(1, strUserType);
      pstmt.setString(2, strMenuGroup);
      pstmt.setString(3, strLookupFunction);

      rst = pstmt.executeQuery();

      if (rst.next()){
         blnFound = true;
      }


this will produce true in 8.04 but not 8.1. There are other (similar)
statements against these tables that have stopped working.
the tables are defines as follows

                   Table "public.menuitem"
   Column    |         Type          |       Modifiers
-------------+-----------------------+------------------------
 menuitemid  | character varying(20) | not null
 description | character varying(30) | not null
 url         | character varying(50) | not null
 menuprog    | boolean               | not null default false

          Table "public.menuitemtypes"
   Column   |         Type          | Modifiers
------------+-----------------------+-----------
 usertype   | character varying(10) | not null
 menuitemid | character varying(20) | not null

               Table "public.menugroupitem"
   Column    |         Type          |     Modifiers
-------------+-----------------------+--------------------
 menugroupid | character varying(8)  | not null
 menuitemid  | character varying(20) | not null
 sequence    | integer               | not null default 1
 parentmenu  | character varying(8)  | not null

jdbc string parameter values
usertype='ADMIN'
menugroup='ADMIN'
lookupfunction='HOME'

i've checked the gotcha list for 8.1 and tried the insert_missing_from
idea with no change.
i swapped out the default 7.4 jdbc driver for the 8.1 jdbc3driver with
no change.

google reveals no obvious duhh why didn't i think of that stuff.

i have cut and pasted the code into psql and it returns one row, yet
the log data shows that the self same string data returns false in the
jdbc code. i've selected the values from the tables concatenated
between characters to ensure the key values (appear) are identical.

anybody got an idea why it stopped working?


pgsql-jdbc by date:

Previous
From: solar
Date:
Subject: unsubscribe
Next
From: Kris Jurka
Date:
Subject: Re: strange jdbc problem moving to 8.1 database