关于jdbc:聊聊如何获取PreparedStatement的参数
序本文次要钻研一下如何获取PreparedStatement的参数 PreparedStatementjava/sql/PreparedStatement.java public interface PreparedStatement extends Statement { void setNull(int parameterIndex, int sqlType) throws SQLException; void setBoolean(int parameterIndex, boolean x) throws SQLException; void setInt(int parameterIndex, int x) throws SQLException; void setLong(int parameterIndex, long x) throws SQLException; //...... default void setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException { throw new SQLFeatureNotSupportedException("setObject not implemented"); } default void setObject(int parameterIndex, Object x, SQLType targetSqlType) throws SQLException { throw new SQLFeatureNotSupportedException("setObject not implemented"); } /** * Retrieves the number, types and properties of this * <code>PreparedStatement</code> object's parameters. * * @return a <code>ParameterMetaData</code> object that contains information * about the number, types and properties for each * parameter marker of this <code>PreparedStatement</code> object * @exception SQLException if a database access error occurs or * this method is called on a closed <code>PreparedStatement</code> * @see ParameterMetaData * @since 1.4 */ ParameterMetaData getParameterMetaData() throws SQLException;}PreparedStatement继承了Statement接口,它次要是多定义了一系列的set办法,然而没有定义get办法,只是定义了getParameterMetaData办法返回ParameterMetaDataParameterMetaDatajava/sql/ParameterMetaData.java ...