Class PgSQLXML
- java.lang.Object
-
- io.quarkus.jdbc.postgresql.runtime.graal.PgSQLXML
-
- All Implemented Interfaces:
SQLXML
public final class PgSQLXML extends Object implements SQLXML
The PgSQLXML implementation in the PostgreSQL JDBC driver has a dependency on the JDK's XML parsers; while the use of this type is a strong hint that the application's nature is relying on XML processing via the JDK standard libraries, we've observed that this type is also often included in the analysis graph being triggered via {@see java.sql.PreparedStatement#setObject}, which is widely used for other purposes as well. Considering that the efficiency costs of including all of resources and reflective registrations necessary to support the XML parsers is non trivial, we apply here a trick to help the GraalVM native image compiler avoid this inclusion unless this feature is actually is reachable, by isolating the construction of the parsers and their supporting other types via a reflective call. This reflective invocation exists merely to give us a control knob to toggle the inclusion of this code; it so happens that we can trigger the toggle automatically so to not manifest as semantic changes for the Quarkus users who don't need to know about this.- Author:
- Sanne Grinovero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
free()
InputStream
getBinaryStream()
Reader
getCharacterStream()
<T extends Source>
TgetSource(Class<T> sourceClass)
String
getString()
OutputStream
setBinaryStream()
Writer
setCharacterStream()
<T extends Result>
TsetResult(Class<T> resultClass)
void
setString(String value)
-
-
-
Constructor Detail
-
PgSQLXML
public PgSQLXML(org.postgresql.core.BaseConnection conn)
-
PgSQLXML
public PgSQLXML(org.postgresql.core.BaseConnection conn, String data)
-
-
Method Detail
-
getBinaryStream
public InputStream getBinaryStream() throws SQLException
- Specified by:
getBinaryStream
in interfaceSQLXML
- Throws:
SQLException
-
getCharacterStream
public Reader getCharacterStream() throws SQLException
- Specified by:
getCharacterStream
in interfaceSQLXML
- Throws:
SQLException
-
getSource
public <T extends Source> T getSource(Class<T> sourceClass) throws SQLException
- Specified by:
getSource
in interfaceSQLXML
- Throws:
SQLException
-
getString
public String getString() throws SQLException
- Specified by:
getString
in interfaceSQLXML
- Throws:
SQLException
-
setBinaryStream
public OutputStream setBinaryStream() throws SQLException
- Specified by:
setBinaryStream
in interfaceSQLXML
- Throws:
SQLException
-
setCharacterStream
public Writer setCharacterStream() throws SQLException
- Specified by:
setCharacterStream
in interfaceSQLXML
- Throws:
SQLException
-
setResult
public <T extends Result> T setResult(Class<T> resultClass) throws SQLException
- Specified by:
setResult
in interfaceSQLXML
- Throws:
SQLException
-
setString
public void setString(String value) throws SQLException
- Specified by:
setString
in interfaceSQLXML
- Throws:
SQLException
-
-