@@ -44,26 +44,17 @@ class CachedCallableStatement extends CachedPreparedStatement<CallableStatement>
4444
4545 @ Override
4646 public void registerOutParameter (int parameterIndex , int sqlType ) throws SQLException {
47- if (backendStatement != null )
48- backendStatement .registerOutParameter (parameterIndex , sqlType );
49- else
50- throw new SQLFeatureNotSupportedException ();
47+ checkBackendStatement ().registerOutParameter (parameterIndex , sqlType );
5148 }
5249
5350 @ Override
5451 public void registerOutParameter (int parameterIndex , int sqlType , int scale ) throws SQLException {
55- if (backendStatement != null )
56- backendStatement .registerOutParameter (parameterIndex , sqlType , scale );
57- else
58- throw new SQLFeatureNotSupportedException ();
52+ checkBackendStatement ().registerOutParameter (parameterIndex , sqlType , scale );
5953 }
6054
6155 @ Override
6256 public boolean wasNull () throws SQLException {
63- if (backendStatement != null )
64- return backendStatement .wasNull ();
65- else
66- throw new SQLFeatureNotSupportedException ();
57+ return checkBackendStatement ().wasNull ();
6758 }
6859
6960 @ Override
@@ -389,18 +380,12 @@ public void setTimestamp(String parameterName, Timestamp x) throws SQLException
389380
390381 @ Override
391382 public void setAsciiStream (String parameterName , InputStream x , int length ) throws SQLException {
392- if (backendStatement != null )
393- backendStatement .setAsciiStream (parameterName , x , length );
394- else
395- throw new SQLFeatureNotSupportedException ();
383+ checkBackendStatement ().setAsciiStream (parameterName , x , length );
396384 }
397385
398386 @ Override
399387 public void setBinaryStream (String parameterName , InputStream x , int length ) throws SQLException {
400- if (backendStatement != null )
401- backendStatement .setBinaryStream (parameterName , x , length );
402- else
403- throw new SQLFeatureNotSupportedException ();
388+ checkBackendStatement ().setBinaryStream (parameterName , x , length );
404389 }
405390
406391 @ Override
@@ -426,10 +411,7 @@ public void setObject(String parameterName, Object x) throws SQLException {
426411
427412 @ Override
428413 public void setCharacterStream (String parameterName , Reader reader , int length ) throws SQLException {
429- if (backendStatement != null )
430- backendStatement .setCharacterStream (parameterName , reader , length );
431- else
432- throw new SQLFeatureNotSupportedException ();
414+ checkBackendStatement ().setCharacterStream (parameterName , reader , length );
433415 }
434416
435417 @ Override
@@ -676,46 +658,28 @@ public void setNString(String parameterName, String value) throws SQLException {
676658
677659 @ Override
678660 public void setNCharacterStream (String parameterName , Reader value , long length ) throws SQLException {
679- if (backendStatement != null )
680- backendStatement .setNCharacterStream (parameterName , value , length );
681- else
682- throw new SQLFeatureNotSupportedException ();
661+ checkBackendStatement ().setNCharacterStream (parameterName , value , length );
683662
684663 }
685664
686665 @ Override
687666 public void setNClob (String parameterName , NClob value ) throws SQLException {
688- if (backendStatement != null )
689- backendStatement .setNClob (parameterName , value );
690- else
691- throw new SQLFeatureNotSupportedException ();
692-
667+ checkBackendStatement ().setNClob (parameterName , value );
693668 }
694669
695670 @ Override
696671 public void setClob (String parameterName , Reader reader , long length ) throws SQLException {
697- if (backendStatement != null )
698- backendStatement .setClob (parameterName , reader , length );
699- else
700- throw new SQLFeatureNotSupportedException ();
672+ checkBackendStatement ().setClob (parameterName , reader , length );
701673 }
702674
703675 @ Override
704676 public void setBlob (String parameterName , InputStream inputStream , long length ) throws SQLException {
705- if (backendStatement != null )
706- backendStatement .setBlob (parameterName , inputStream , length );
707- else
708- throw new SQLFeatureNotSupportedException ();
709-
677+ checkBackendStatement ().setBlob (parameterName , inputStream , length );
710678 }
711679
712680 @ Override
713681 public void setNClob (String parameterName , Reader reader , long length ) throws SQLException {
714- if (backendStatement != null )
715- backendStatement .setNClob (parameterName , reader , length );
716- else
717- throw new SQLFeatureNotSupportedException ();
718-
682+ checkBackendStatement ().setNClob (parameterName , reader , length );
719683 }
720684
721685 @ Override
@@ -736,11 +700,7 @@ public NClob getNClob(String parameterName) throws SQLException {
736700
737701 @ Override
738702 public void setSQLXML (String parameterName , SQLXML xmlObject ) throws SQLException {
739- if (backendStatement != null )
740- backendStatement .setSQLXML (parameterName , xmlObject );
741- else
742- throw new SQLFeatureNotSupportedException ();
743-
703+ checkBackendStatement ().setSQLXML (parameterName , xmlObject );
744704 }
745705
746706 @ Override
@@ -809,100 +769,62 @@ public Reader getCharacterStream(String parameterName) throws SQLException {
809769
810770 @ Override
811771 public void setBlob (String parameterName , Blob x ) throws SQLException {
812- if (backendStatement != null )
813- backendStatement .setBlob (parameterName , x );
814- else
815- throw new SQLFeatureNotSupportedException ();
772+ checkBackendStatement ().setBlob (parameterName , x );
816773 }
817774
818775 @ Override
819776 public void setClob (String parameterName , Clob x ) throws SQLException {
820- if (backendStatement != null )
821- backendStatement .setClob (parameterName , x );
822- else
823- throw new SQLFeatureNotSupportedException ();
777+ checkBackendStatement ().setClob (parameterName , x );
824778 }
825779
826780 @ Override
827781 public void setAsciiStream (String parameterName , InputStream x , long length ) throws SQLException {
828- if (backendStatement != null )
829- backendStatement .setAsciiStream (parameterName , x , length );
830- else
831- throw new SQLFeatureNotSupportedException ();
782+ checkBackendStatement ().setAsciiStream (parameterName , x , length );
832783 }
833784
834785 @ Override
835786 public void setBinaryStream (String parameterName , InputStream x , long length ) throws SQLException {
836- if (backendStatement != null )
837- backendStatement .setBinaryStream (parameterName , x , length );
838- else
839- throw new SQLFeatureNotSupportedException ();
787+ checkBackendStatement ().setBinaryStream (parameterName , x , length );
840788 }
841789
842790 @ Override
843791 public void setCharacterStream (String parameterName , Reader reader , long length ) throws SQLException {
844- if (backendStatement != null )
845- backendStatement .setCharacterStream (parameterName , reader , length );
846- else
847- throw new SQLFeatureNotSupportedException ();
792+ checkBackendStatement ().setCharacterStream (parameterName , reader , length );
848793 }
849794
850795 @ Override
851796 public void setAsciiStream (String parameterName , InputStream x ) throws SQLException {
852- if (backendStatement != null )
853- backendStatement .setAsciiStream (parameterName , x );
854- else
855- throw new SQLFeatureNotSupportedException ();
797+ checkBackendStatement ().setAsciiStream (parameterName , x );
856798 }
857799
858800 @ Override
859801 public void setBinaryStream (String parameterName , InputStream x ) throws SQLException {
860- if (backendStatement != null )
861- backendStatement .setBinaryStream (parameterName , x );
862- else
863- throw new SQLFeatureNotSupportedException ();
802+ checkBackendStatement ().setBinaryStream (parameterName , x );
864803 }
865804
866805 @ Override
867806 public void setCharacterStream (String parameterName , Reader reader ) throws SQLException {
868- if (backendStatement != null )
869- backendStatement .setCharacterStream (parameterName , reader );
870- else
871- throw new SQLFeatureNotSupportedException ();
872-
807+ checkBackendStatement ().setCharacterStream (parameterName , reader );
873808 }
874809
875810 @ Override
876811 public void setNCharacterStream (String parameterName , Reader value ) throws SQLException {
877- if (backendStatement != null )
878- backendStatement .setNCharacterStream (parameterName , value );
879- else
880- throw new SQLFeatureNotSupportedException ();
812+ checkBackendStatement ().setNCharacterStream (parameterName , value );
881813 }
882814
883815 @ Override
884816 public void setClob (String parameterName , Reader reader ) throws SQLException {
885- if (backendStatement != null )
886- backendStatement .setClob (parameterName , reader );
887- else
888- throw new SQLFeatureNotSupportedException ();
817+ checkBackendStatement ().setClob (parameterName , reader );
889818 }
890819
891820 @ Override
892821 public void setBlob (String parameterName , InputStream inputStream ) throws SQLException {
893- if (backendStatement != null )
894- backendStatement .setBlob (parameterName , inputStream );
895- else
896- throw new SQLFeatureNotSupportedException ();
897-
822+ checkBackendStatement ().setBlob (parameterName , inputStream );
898823 }
899824
900825 @ Override
901826 public void setNClob (String parameterName , Reader reader ) throws SQLException {
902- if (backendStatement != null )
903- backendStatement .setNClob (parameterName , reader );
904- else
905- throw new SQLFeatureNotSupportedException ();
827+ checkBackendStatement ().setNClob (parameterName , reader );
906828 }
907829
908830 @ Override
0 commit comments