× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



 Hi Patrick:
I have an Excel file AFILE and sheet ASHEET. How do I code the these two
statements?

               excelConnection = DriverManager.getConnection("jdbc:odbc:" +
odbcName, "",
               String excelQuery = "select * from [Contacts$];";
file://Excel sheet name
Thanks.

Bruce

----- Original Message -----
From: <Patrick.F.O'Dowd@gsk.com>
To: <java400-l@midrange.com>
Sent: Monday, March 04, 2002 5:47 AM
Subject: Re: Transfer Exell to AS400


>
>
> I have used jdbc to load excel spreadsheet to as400 files:
>                Connection excelConnection = null;
>                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>                excelConnection = DriverManager.getConnection("jdbc:odbc:"
+ odbcName, "", "");
>
>
>                Statement excelSelect = null;
>                excelSelect = excelConnection.createStatement();
>                String excelQuery = "select * from [Contacts$];";
file://Excel sheet name
>                ResultSet excelData = excelSelect.executeQuery(excelQuery);
>
>                while (excelData.next()) {
>                            String node = excelData.getString("Node");
>                            String contactName =
excelData.getString("Contact Name");
>
>                     etc..
>
> To convert the excel data to XML, you could use JDOM.
>
>



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.