Harshal
Harshal

Reputation: 15

accessing excel as database using jdbc on remote server

I want to access the excel file stored on the remote server through java application. I want to use jdbc for that. The apache poi is working but i want to do it using the jdbc for the desktop application.

Upvotes: 0

Views: 421

Answers (1)

Shiva
Shiva

Reputation: 6885

The easiest way of achieving it would be to use Fillo.

Fillo is an Excel API for Java and you can query xls & xlsx files. Now, it supports SELECT, UPDATE & INSERT queries with or without WHERE clause.

The sample code will look something like this.

Fillo fillo=new Fillo();
Connection connection=fillo.getConnection("C:\\Test.xlsx");
String strQuery="Select * from Sheet1 where ID=100 and name='John'";
Recordset recordset=connection.executeQuery(strQuery);

while(recordset.next()){
    System.out.println(recordset.getField("Details"));
}

recordset.close();
connection.close();

Upvotes: 1

Related Questions