Getting one value from SQL select statement in Java

前端 未结 6 902
野性不改
野性不改 2020-12-18 04:27

I\'m trying to return a value from a select statement. Its only one value because the value I\'m returning is from the primary key column.

The SQL statement is

6条回答
  •  情深已故
    2020-12-18 05:21

    Use rs.getInt(1) or rs.getString(1) to retrieve the actual value from the ResultSet. Then read a JDBC tutorial.

提交回复
热议问题