Skip to content
/ dbutil Public

Java Library for Generate Table/ComboBox Models from sql ResultSets

License

Notifications You must be signed in to change notification settings

gayanch/dbutil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DBUtil

Java Library for Generate Table/ComboBox/List Models and Vectors from sql ResultSets

Example of Usage

  • Suppose you have a ResultSet called res created by executing following sql Query SELECT name AS Name, age AS Age FROM student

  • DefaultTableModel DefaultTableModel dtm = DBUtil.resultSetToTableModel(res);

  • DefaultComboBoxModel DefaultComboBoxModel<Object> dcm = DBUtil.resultSetToComboBoxModel(res);

  • ListModel DefaultListModel<Object> dlm = DBUtil.resultSetToListModel(res);

  • Vector filled with column names in ResultSet Vector<String> col = DBUtil.resultSetToColumnNameVector(res);

  • Vector of Vectors with row data Vector<Object> rows = DBUtil.resultSetToRowsVector(res);

Notes

  • Add dbutil.jar file to your classpath before using.
  • And import DBUtil by import org.gck.DBUtil;
  • See JavaDocs for other useful overloaded methods.

About

Java Library for Generate Table/ComboBox Models from sql ResultSets

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages