如何在Java中仅从数据库中获取两行数据来获取多行 [英] how to fetch multiple rows with only two colums of data from database, in java

查看:585
本文介绍了如何在Java中仅从数据库中获取两行数据来获取多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨....

在JDBC中,我试图仅从EMPLOYEE表中获取所有雇员的两个字段(EMPLOYEE_ID和SALARY)...我使用了集合,但是却出错了.
请让我高兴..

谢谢U ..

Hi ....

In JDBC i''m trying to fetch only two fields(EMPLOYEE_ID and SALARY) of all employees from EMPLOYEE table... i used collection,but I''m getting error..

pls giude me..

Thank U..

推荐答案



请参阅以下链接.

您可以使用ResultSet集合.


http://www.mkyong.com/jdbc/jdbc-preparestatement -example-select-list-of-the-records/ [
Hi,

Please see the following link.

You can use a ResultSet collection.


http://www.mkyong.com/jdbc/jdbc-preparestatement-example-select-list-of-the-records/[JDBC Prepared Statement]


这篇关于如何在Java中仅从数据库中获取两行数据来获取多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆