📄 sqlnullcheckedresultset.java
字号:
public int getNullInt() { return this.nullInt; } /** * Returns the value when a SQL null is encountered as the result of * invoking a <code>getLong</code> method. * * @return the value */ public long getNullLong() { return this.nullLong; } /** * Returns the value when a SQL null is encountered as the result of * invoking a <code>getObject</code> method. * * @return the value */ public Object getNullObject() { return this.nullObject; } /** * Returns the value when a SQL null is encountered as the result of * invoking a <code>getRef</code> method. * * @return the value */ public Ref getNullRef() { return this.nullRef; } /** * Returns the value when a SQL null is encountered as the result of * invoking a <code>getShort</code> method. * * @return the value */ public short getNullShort() { return this.nullShort; } /** * Returns the value when a SQL null is encountered as the result of * invoking a <code>getString</code> method. * * @return the value */ public String getNullString() { return this.nullString; } /** * Returns the value when a SQL null is encountered as the result of * invoking a <code>getTime</code> method. * * @return the value */ public Time getNullTime() { return this.nullTime; } /** * Returns the value when a SQL null is encountered as the result of * invoking a <code>getTimestamp</code> method. * * @return the value */ public Timestamp getNullTimestamp() { return this.nullTimestamp; } /** * Returns the value when a SQL null is encountered as the result of * invoking a <code>getURL</code> method. * * @return the value */ public URL getNullURL() { return this.nullURL; } /** * Intercepts calls to <code>get*</code> methods and calls the appropriate * <code>getNull*</code> method if the <code>ResultSet</code> returned * <code>null</code>. * * @throws Throwable * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) */ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Object result = method.invoke(this.rs, args); Method nullMethod = (Method) nullMethods.get(method.getName()); // Check nullMethod != null first so that we don't call wasNull() // before a true getter method was invoked on the ResultSet. return (nullMethod != null && this.rs.wasNull()) ? nullMethod.invoke(this, null) : result; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getAsciiStream</code> method. * * @param nullAsciiStream the value */ public void setNullAsciiStream(InputStream nullAsciiStream) { this.nullAsciiStream = nullAsciiStream; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getBigDecimal</code> method. * * @param nullBigDecimal the value */ public void setNullBigDecimal(BigDecimal nullBigDecimal) { this.nullBigDecimal = nullBigDecimal; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getBinaryStream</code> method. * * @param nullBinaryStream the value */ public void setNullBinaryStream(InputStream nullBinaryStream) { this.nullBinaryStream = nullBinaryStream; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getBlob</code> method. * * @param nullBlob the value */ public void setNullBlob(Blob nullBlob) { this.nullBlob = nullBlob; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getBoolean</code> method. * * @param nullBoolean the value */ public void setNullBoolean(boolean nullBoolean) { this.nullBoolean = nullBoolean; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getByte</code> method. * * @param nullByte the value */ public void setNullByte(byte nullByte) { this.nullByte = nullByte; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getBytes</code> method. * * @param nullBytes the value */ public void setNullBytes(byte[] nullBytes) { this.nullBytes = nullBytes; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getCharacterStream</code> method. * * @param nullCharacterStream the value */ public void setNullCharacterStream(Reader nullCharacterStream) { this.nullCharacterStream = nullCharacterStream; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getClob</code> method. * * @param nullClob the value */ public void setNullClob(Clob nullClob) { this.nullClob = nullClob; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getDate</code> method. * * @param nullDate the value */ public void setNullDate(Date nullDate) { this.nullDate = nullDate; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getDouble</code> method. * * @param nullDouble the value */ public void setNullDouble(double nullDouble) { this.nullDouble = nullDouble; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getFloat</code> method. * * @param nullFloat the value */ public void setNullFloat(float nullFloat) { this.nullFloat = nullFloat; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getInt</code> method. * * @param nullInt the value */ public void setNullInt(int nullInt) { this.nullInt = nullInt; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getLong</code> method. * * @param nullLong the value */ public void setNullLong(long nullLong) { this.nullLong = nullLong; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getObject</code> method. * * @param nullObject the value */ public void setNullObject(Object nullObject) { this.nullObject = nullObject; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getRef</code> method. * * @param nullRef the value */ public void setNullRef(Ref nullRef) { this.nullRef = nullRef; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getShort</code> method. * * @param nullShort the value */ public void setNullShort(short nullShort) { this.nullShort = nullShort; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getString</code> method. * * @param nullString the value */ public void setNullString(String nullString) { this.nullString = nullString; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getTime</code> method. * * @param nullTime the value */ public void setNullTime(Time nullTime) { this.nullTime = nullTime; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getTimestamp</code> method. * * @param nullTimestamp the value */ public void setNullTimestamp(Timestamp nullTimestamp) { this.nullTimestamp = nullTimestamp; } /** * Sets the value to return when a SQL null is encountered as the result of * invoking a <code>getURL</code> method. * * @param nullURL the value */ public void setNullURL(URL nullURL) { this.nullURL = nullURL; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -