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 LocalTime minusHours() method with example
  2. Java RSAPublicKeySpec getParams() method with example
  3. Java Synthesizer getAvailableInstruments() method with example
  4. Java – ValueRange Class
  5. Java Types getDeclaredType() method with example
  6. Java Manifest equals() method with example
  7. Java Characters getData() method with example
  8. Java View getDocument() method with example
  9. Java LayerUI applyPropertyChange() method with example
  10. Java – MidiChannel Interface
  11. Java StyleContext.NamedStyle getAttributeCount() method with example
  12. Java CompletionStage runAfterEitherAsync() method with example 1
  13. Java BaseRowSet setNClob() method with example 5
  14. Java ThaiBuddhistDate getEra() method with example
  15. Java VetoableChangeListener vetoableChange() method with example

Be the first to comment