且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Java MySQL中计算数据

更新时间:2023-02-11 16:37:00

您应该打印 rs.getInt(1)。当您从某个表中选择某些数据的计数时,结果将作为结果集中的整数列返回。

You should print rs.getInt (1). When you select a count of some data from some table, the result is returned as an integer column in the result set.

请尝试:

JOptionPane.showMessageDialog(null,现有停车位数为+ rs.getInt(1));