JDBC API Reference
Obtaining Data from a Result Set
ResultSet objects provide a variety of methods to obtain data from a result set. Table 1 lists the common methods for obtaining data. If you want to know more about other methods, see JDK official documents.
Method |
Description |
Difference |
---|---|---|
int getInt(int columnIndex) |
Obtains int data by column index. |
- |
int getInt(String columnLabel) |
Obtains int data by column name. |
- |
String getString(int columnIndex) |
Obtains string data by column index. |
If the column type is integer and the column contains the ZEROFILL attribute, GaussDB pads 0s to meet the width required by the ZEROFILL attribute and outputs the result. MySQL directly outputs the result. |
String getString(String columnLabel) |
Obtains string data by column name. |
If the column type is integer and the column contains the ZEROFILL attribute, GaussDB pads 0s to meet the width required by the ZEROFILL attribute and outputs the result. MySQL directly outputs the result. |
Date getDate(int columnIndex) |
Obtains date data by column index. |
- |
Date getDate(String columnLabel) |
Obtains date data by column name. |
- |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot