JTable + JDBC:最简单的方法 [英] JTable+JDBC: Easiest way

查看:134
本文介绍了JTable + JDBC:最简单的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类查看有一个JTable和另一个类 DB
DB 是一个具有数据库连接的方法。
当从 View 调用此方法时,我希望它从数据库返回整个数据。
我应该使用什么作为返回类型?
List,Vector,Array,Map,...?

I have a class View with a JTable and another class DB. In DB is a method with a database connection. When calling this method from View, I want it to return the whole data from the database. What exactly should I use as the return type? List, Vector, Array, Map,...?

我阅读了许多教程,但对各种可能性感到困惑。
我真的是最简单的方法,只是为了理解它是如何工作的。

I read lots of tutorials, but got very confused of the various possibilities. I really nead the easiest way, just to understand how it works.

推荐答案

返回类型应该是什么希望您的TableModel支持。

The return type should be whatever you want your TableModel to support.

请参阅表从数据库一些想法。

这篇关于JTable + JDBC:最简单的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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