From 25804a6020c5f7dec254f4dbeee42584d08b9d38 Mon Sep 17 00:00:00 2001 From: zhangting Date: Tue, 12 Mar 2024 16:53:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3jdbc=E6=9F=A5=E8=AF=A2String?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=B8=BAPGObject=E7=B1=BB=E5=9E=8B=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/postgresql/jdbc/PgConnection.java | 42 +------------------ 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java b/pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java index cfefefd..2276c40 100644 --- a/pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java +++ b/pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java @@ -818,47 +818,7 @@ public class PgConnection implements BaseConnection { PSQLState.NOT_IMPLEMENTED); } } - - PGobject obj = null; - - if (LOGGER.isTraceEnabled()) { - LOGGER.trace("Constructing object from type=" + type + " value=<" + value + ">"); - } - - try { - Class klass = _typeCache.getPGobject(type); - - // If className is not null, then try to instantiate it, - // It must be basetype PGobject - - // This is used to implement the org.postgresql unique types (like lseg, - // point, etc). - - if (klass != null) { - obj = klass.newInstance(); - obj.setType(type); - if (byteValue != null && obj instanceof PGBinaryObject) { - PGBinaryObject binObj = (PGBinaryObject) obj; - binObj.setByteValue(byteValue, 0); - } else { - obj.setValue(value); - } - } else { - // If className is null, then the type is unknown. - // so return a PGobject with the type set, and the value set - obj = new PGobject(); - obj.setType(type); - obj.setValue(value); - } - - return obj; - } catch (SQLException sx) { - // rethrow the exception. Done because we capture any others next - throw sx; - } catch (Exception ex) { - throw new PSQLException(GT.tr("Failed to create object for: {0}.", type), - PSQLState.CONNECTION_FAILURE, ex); - } + return value; } protected TypeInfo createTypeInfo(BaseConnection conn, int unknownLength) { -- Gitee