List of usage examples for java.sql PreparedStatement setNull
void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException;
NULL
. From source file:org.deegree.sqldialect.oracle.OracleGeometryConverter.java
@Override public void setParticle(PreparedStatement stmt, Geometry particle, int paramIndex) throws SQLException { try {/* ww w. jav a 2 s . c o m*/ if (particle == null) { stmt.setNull(paramIndex, Types.STRUCT, "MDSYS.SDO_GEOMETRY"); } else { Geometry compatible = getCompatibleGeometry(particle); // TODO clarify if this was only a wkt/wkb requirement ?! // (background Envelope -> Optimized Rectangles in Oracle are preferred and faster for SDO_RELATE // filters ) // // if ( compatible instanceof Envelope ) { // compatible = compatible.getConvexHull(); // } OracleConnection ocon = getOracleConnection(stmt.getConnection()); Object struct = new SDOGeometryConverter().fromGeometry(ocon, isrid, compatible, true); stmt.setObject(paramIndex, struct); } } catch (Throwable t) { t.printStackTrace(); throw new IllegalArgumentException(); } }