Android Pull parsing xml

Source: Internet
Author: User

Package Project02_order_management.util;import Java.sql.resultset;import Java.sql.sqlexception;import Javax.swing.jtable;import javax.swing.table.defaulttablemodel;/** * A JTable tool class <br> * Initialize table data * * @author Martin Dong * */public class Tableutil {/** * declares the table control */private static JTable jtable;/** * Initializes the default data model */private static default TableModel dtm;/** * Initialize jtable control * * @param rst * Incoming result set * @param columnnames * table header for incoming table * @return Returns the JTable control entity */public static JTable inittable (ResultSet rst, string[] columnnames) {DTM = new DefaultTableModel (Initdate ( RST, columnnames), ColumnNames) {public boolean iscelleditable (int row, int column) {return false;}}; jTable = new jTable (DTM); return jTable;} /** * Initialize default data Model * * @param rst * Incoming result set * @param columnnames * table header for incoming table * @return return two-dimensional data */public Static object[][] Initdate (ResultSet rst, string[] columnnames) {object[][] rowdate = null;if (rst! = NULL) {//move cursor to last row of The ResultSet object. In order to get all the data row try {Rst.last (); rowdate = new Object[rst.getrow ()][columnnames.length];int index = 0;//move to the first data wade is behind the Traverse Rst.first ();// Since it is necessary to traverse from the first one, a row of data is moved up from the first record rst.previous (), while (Rst.next ()) {for (int j = 0; J < Columnnames.length; J + +) {Rowdate[i NDEX][J] = Rst.getobject (j + 1);} index++;}} catch (SQLException e) {//TODO auto-generated catch Blocke.printstacktrace ();}} return rowdate;}}

Android Pull parsing xml

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.