Java CallableStatement getString() method with example

java.sql.CallableStatement.getString() method Retrieves the value of the designated JDBC
LONGVARCHAR parameter as a
String in the Java programming language.

For the fixed-length type JDBC CHAR, the String object returned has exactly the same value the SQL CHAR value had in the database, including any padding added by the database.

CallableStatement getString() method Signature

String getString(int parameterIndex) throws SQLException


parameterIndex – the first parameter is 1, the second is 2, and so on


the parameter value. If the value is SQL
NULL, the result is


SQLException – if the parameterIndex is not valid; if a database access error occurs or this method is called on a closed

See Also:

setString(java.lang.String, java.lang.String)

java.sql.CallableStatement.getString() method Implementation

String getString(int parameterIndex) throws SQLException{

CallableStatement getString() method Example


public class GetStringMethodExample {

	public static void main(String[] args) {




Ask your questions in eHowToNow Forum

Post your technical, non-technical doubts, questions in our site. Get answer as soon as possible, meanwhile you can help others by answering, unanswered questions.
To Ask new Question : Ask Question
Check our existing discussions : Questions & Answers

  1. Java – OctetSeqHelper Class
  2. Java ReplicateScaleFilter setDimensions() method with example
  3. Java FileChannel position() method with example
  4. javax.xml.crypto.dsig.spec Package
  5. Java CounterMonitor getThreshold() method with example 1
  6. Java BasicSplitPaneDivider.VerticalDragController getNeededLocation() method with example
  7. Java BandedSampleModel setSample() method with example
  8. Java InitialContext getDefaultInitCtx() method with example
  9. Java SpringLayout minimumLayoutSize() method with example
  10. Java BasicDesktopPaneUI.NavigateAction actionPerformed() method with example
  11. Java CompositeView getNextEastWestVisualPositionFrom() method with example
  12. Java OffsetDateTime withSecond() method with example
  13. Java ForwardingFileObject delete() method with example
  14. Java NumberUp getCategory() method with example
  15. Java ArrayList spliterator() method with example

Be the first to comment