? .build.local.properties.swp ? build.local.properties ? getproccol.patch Index: org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java,v retrieving revision 1.33 diff -c -r1.33 AbstractJdbc2DatabaseMetaData.java *** org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java 1 Dec 2006 08:53:45 -0000 1.33 --- org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java 28 Feb 2007 07:39:43 -0000 *************** *** 1724,1731 **** String sql; if (connection.haveMinimumServerVersion("7.3")) { ! sql = "SELECT n.nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid " + ! " FROM pg_catalog.pg_proc p,pg_catalog.pg_namespace n, pg_catalog.pg_type t " + " WHERE p.pronamespace=n.oid AND p.prorettype=t.oid "; if (schemaPattern != null && !"".equals(schemaPattern)) { --- 1724,1739 ---- String sql; if (connection.haveMinimumServerVersion("7.3")) { ! sql = "SELECT n.nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid "; ! ! if (connection.haveMinimumServerVersion("8.1")) ! sql += ", p.proargnames, p.proargmodes, p.proallargtypes "; ! else if (connection.haveMinimumServerVersion("8.0")) ! sql += ", p.proargnames, NULL AS proargmodes, NULL AS proallargtypes "; ! else ! sql += ", NULL AS proargnames, NULL AS proargmodes, NULL AS proallargtypes "; ! ! sql += " FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n, pg_catalog.pg_type t " + " WHERE p.pronamespace=n.oid AND p.prorettype=t.oid "; if (schemaPattern != null && !"".equals(schemaPattern)) { *************** *** 1739,1745 **** } else { ! sql = "SELECT NULL AS nspname,p.proname,p.prorettype,p.proargtypes, t.typtype,t.typrelid " + " FROM pg_proc p,pg_type t " + " WHERE p.prorettype=t.oid "; if (procedureNamePattern != null) --- 1747,1753 ---- } else { ! sql = "SELECT NULL AS nspname,p.proname,p.prorettype,p.proargtypes,t.typtype,t.typrelid, NULL AS proargnames, NULL AS proargmodes, NULL AS proallargtypes " + " FROM pg_proc p,pg_type t " + " WHERE p.prorettype=t.oid "; if (procedureNamePattern != null) *************** *** 1757,1768 **** int returnType = rs.getInt("prorettype"); String returnTypeType = rs.getString("typtype"); int returnTypeRelid = rs.getInt("typrelid"); String strArgTypes = rs.getString("proargtypes"); StringTokenizer st = new StringTokenizer(strArgTypes); Vector argTypes = new Vector(); while (st.hasMoreTokens()) { ! argTypes.addElement(new Integer(st.nextToken())); } // decide if we are returning a single column result. --- 1765,1796 ---- int returnType = rs.getInt("prorettype"); String returnTypeType = rs.getString("typtype"); int returnTypeRelid = rs.getInt("typrelid"); + String strArgTypes = rs.getString("proargtypes"); StringTokenizer st = new StringTokenizer(strArgTypes); Vector argTypes = new Vector(); while (st.hasMoreTokens()) { ! argTypes.addElement(new Long(st.nextToken())); ! } ! ! String argNames[] = null; ! Array argNamesArray = rs.getArray("proargnames"); ! if (argNamesArray != null) ! argNames = (String[])argNamesArray.getArray(); ! ! String argModes[] = null; ! Array argModesArray = rs.getArray("proargmodes"); ! if (argModesArray != null) ! argModes = (String[])argModesArray.getArray(); ! ! int numArgs = argTypes.size(); ! ! long allArgTypes[] = null; ! Array allArgTypesArray = rs.getArray("proallargtypes"); ! if (allArgTypesArray != null) { ! allArgTypes = (long[])allArgTypesArray.getArray(); ! numArgs = allArgTypes.length; } // decide if we are returning a single column result. *************** *** 1786,1807 **** } // Add a row for each argument. ! for (int i = 0; i < argTypes.size(); i++) { - int argOid = ((Integer)argTypes.elementAt(i)).intValue(); byte[][] tuple = new byte[13][]; tuple[0] = null; tuple[1] = schema; tuple[2] = procedureName; ! tuple[3] = connection.encodeString("$" + (i + 1)); ! tuple[4] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureColumnIn)); tuple[5] = connection.encodeString(Integer.toString(connection.getSQLType(argOid))); tuple[6] = connection.encodeString(connection.getPGType(argOid)); tuple[7] = null; tuple[8] = null; tuple[9] = null; tuple[10] = null; ! tuple[11] = connection.encodeString(Integer.toString(java.sql.DatabaseMetaData.procedureNullableUnknown)); tuple[12] = null; v.addElement(tuple); } --- 1814,1852 ---- } // Add a row for each argument. ! for (int i = 0; i < numArgs; i++) { byte[][] tuple = new byte[13][]; tuple[0] = null; tuple[1] = schema; tuple[2] = procedureName; ! ! if (argNames != null) ! tuple[3] = connection.encodeString(argNames[i]); ! else ! tuple[3] = connection.encodeString("$" + (i + 1)); ! ! int columnMode = DatabaseMetaData.procedureColumnIn; ! if (argModes != null && argModes[i].equals("o")) ! columnMode = DatabaseMetaData.procedureColumnOut; ! else if (argModes != null && argModes[i].equals("b")) ! columnMode = DatabaseMetaData.procedureColumnInOut; ! ! tuple[4] = connection.encodeString(Integer.toString(columnMode)); ! ! int argOid; ! if (allArgTypes != null) ! argOid = (int)allArgTypes[i]; ! else ! argOid = ((Long)argTypes.elementAt(i)).intValue(); ! tuple[5] = connection.encodeString(Integer.toString(connection.getSQLType(argOid))); tuple[6] = connection.encodeString(connection.getPGType(argOid)); tuple[7] = null; tuple[8] = null; tuple[9] = null; tuple[10] = null; ! tuple[11] = connection.encodeString(Integer.toString(DatabaseMetaData.procedureNullableUnknown)); tuple[12] = null; v.addElement(tuple); } *************** *** 1830,1835 **** --- 1875,1881 ---- tuple[12] = null; v.addElement(tuple); } + columnrs.close(); } } rs.close(); Index: org/postgresql/jdbc2/TypeInfoCache.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/jdbc2/TypeInfoCache.java,v retrieving revision 1.7 diff -c -r1.7 TypeInfoCache.java *** org/postgresql/jdbc2/TypeInfoCache.java 19 Feb 2007 05:57:53 -0000 1.7 --- org/postgresql/jdbc2/TypeInfoCache.java 28 Feb 2007 07:39:43 -0000 *************** *** 57,62 **** --- 57,63 ---- {"numeric", new Integer(Oid.NUMERIC), new Integer(Types.NUMERIC), "java.math.BigDecimal"}, {"float4", new Integer(Oid.FLOAT4), new Integer(Types.REAL), "java.lang.Float"}, {"float8", new Integer(Oid.FLOAT8), new Integer(Types.DOUBLE), "java.lang.Double"}, + {"char", new Integer(Oid.CHAR), new Integer(Types.CHAR), "java.lang.String"}, {"bpchar", new Integer(Oid.BPCHAR), new Integer(Types.CHAR), "java.lang.String"}, {"varchar", new Integer(Oid.VARCHAR), new Integer(Types.VARCHAR), "java.lang.String"}, {"text", new Integer(Oid.TEXT), new Integer(Types.VARCHAR), "java.lang.String"},