Fillo is an Excel API for Java and you can query xls & xlsx files.
It supports DDL , DML AND DCL commands over SQL.
SELECT SQL:
===========
USING SELECT:
=============
public class Filo_Select {
public static void main(String[] args) throws InterruptedException {
Fillo fillo=new Fillo();
Connection connection=fillo.getConnection("C:\\RAMESH\\TestdATA.xlsx");
String strQuery="Select * from Sheet1 where name='Ramesh'";
Recordset recordset=connection.executeQuery(strQuery);
while(recordset.next()){
System.out.println(recordset.getField("Details"));
}
recordset.close();
connection.close();
}
}
It supports DDL , DML AND DCL commands over SQL.
SELECT SQL:
===========
Syntax:
SELECT column1, column2, columnN FROM table_name;
USING SELECT:
=============
public class Filo_Select {
public static void main(String[] args) throws InterruptedException {
Fillo fillo=new Fillo();
Connection connection=fillo.getConnection("C:\\RAMESH\\TestdATA.xlsx");
String strQuery="Select * from Sheet1 where name='Ramesh'";
Recordset recordset=connection.executeQuery(strQuery);
while(recordset.next()){
System.out.println(recordset.getField("Details"));
}
recordset.close();
connection.close();
}
}
No comments:
Post a Comment