java - Is there a way to select only a few columns from Excel to pull into a ODBC-JDBC connection? -


i writing program provide stock data gui, update real time. when use smart tags in excel, updates 13 columns: last, previous, close, high, low, volume, change, % change, 52 wk high, 52 wk low, market cap, eps, p/e ratio, , # shares out. however, want deal few of columns. there way select few of columns pull data from? using pull data , works, don't want of it:

try {         class.forname("sun.jdbc.odbc.jdbcodbcdriver");         connection connect = drivermanager.getconnection("jdbc:odbc:book1");         statement st = connect.createstatement();         resultset result_set = st.executequery("select * a3:p30");         resultsetmetadata md = result_set.getmetadata();         int columns = md.getcolumncount();         (int = 1; <= columns; i++) {             columnnames.addelement(md.getcolumnname(i));         }         while (result_set.next()) {             vector row = new vector(columns);             (int = 1; <= columns; i++)                 row.addelement(result_set.getobject(i));             data.addelement(row);         }         result_set.close();         st.close();     } catch (exception e) {         system.out.println(e);     } 

in book1, have 27 entries p30 comes from.. thank you, in advance!

if have header line last, previous, close, high etc use

select [last],[previous],[close],[high] [sheetname$] 

we using same code , works fine.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -