Results 1 to 4 of 4
Thread: How to Read Excel file??
- 08-13-2009, 09:58 AM #1
Member
- Join Date
- Aug 2009
- Posts
- 8
- Rep Power
- 0
How to Read Excel file??
Hi,
i'm new in java prg
i'm trying to write a code for extracting data from an excel file.
The excel file name is : TEST.XLS
The worksheet name is: qas
In the Tool Administrator, the datasource name is: qa-list
When i excecute the code, i have an error:
java.sql.SQLException: [Microsoft][Pilote ODBC Excel] Not enough parameters 1 waited.
here is my code:
Java Code:package javaexcel; import java.sql.Connection; import java.sql.Statement; import java.sql.ResultSet; import java.sql.DriverManager; public class ExcelReader { public static void main( String [] args ) { Connection c = null; Statement stmnt = null; try { Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" ); c = DriverManager.getConnection( "jdbc:odbc:qa-list", "", "" ); stmnt = c.createStatement(); String query = "select URL from [qas$]where Archive=5;"; ResultSet rs = stmnt.executeQuery( query ); System.out.println( "Found the following URLs for March 2000:" ); while( rs.next() ) { System.out.println( rs.getString( "URL" ) ); } } catch( Exception e ) { System.err.println( e ); } finally { try { stmnt.close(); c.close(); } catch( Exception e ) { System.err.println( e ); } } } }
- 08-13-2009, 10:12 AM #2
Why don't you use POI or JExcel?
- 08-14-2009, 10:15 PM #3
Member
- Join Date
- Aug 2009
- Posts
- 8
- Rep Power
- 0
Problem solved.
thanks
- 08-15-2009, 05:06 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Please mark the thread solved, from thread tools menu, if you've found the solution for your question.
Similar Threads
-
JXL read excel documents
By ironicending in forum Java AppletsReplies: 1Last Post: 09-08-2010, 12:42 AM -
How to read Excel file with java
By chetan-24 in forum New To JavaReplies: 5Last Post: 04-22-2009, 05:11 PM -
how to read openproj(Projity) file i.e. ,POD file(Project Management file)
By mahendra.athneria in forum New To JavaReplies: 0Last Post: 02-11-2009, 09:53 AM -
how to insert date field read from Excel using JExcel to database
By saran123 in forum JDBCReplies: 1Last Post: 10-10-2008, 08:47 AM -
How to read data from excel and store it in db
By saran123 in forum New To JavaReplies: 5Last Post: 10-03-2008, 10:19 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks