This repository demonstrates how to use Codoid's Fillo—an Excel API for Java—to read from and write to Excel files using SQL-like queries. The examples cover common operations such as SELECT, INSERT, and UPDATE on .xls and .xlsx files, with or without WHERE clauses.
-
SQL Syntax: Fillo allows you to treat Excel sheets like database tables. Using simple SQL syntax. Use
SELECT,UPDATE, andINSERTqueries directly on Excel sheets. -
No Coordinate Mapping: No need to track
row[i]andcolumn[j]. Just use column headers as field names. -
Simplified Data-Driven Testing: Ideal for Selenium or API automation frameworks where test data is managed in Excel.
Fillo-Examples
├── src/
│ └── test/
│ └── java/
│ └── (example test classes using Fillo)
├── .gitignore
├── pom.xml
└── README.MD
- src/test: Contains example Java/TestNG classes demonstrating Fillo usage
- pom.xml: Maven configuration with Fillo and TestNG dependencies
- README.MD: Project documentation
- Java (JDK 8)
- Maven for dependency management
- Fillo (Excel API for Java)
- TestNG for running example tests
The project uses the following key dependencies:
<dependency>
<groupId>com.codoid.products</groupId>
<artifactId>fillo</artifactId>
<version>1.23</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.11.0</version>
</dependency>Retrieve values from an Excel sheet where the sheet name is treated as the table name.
Fillo fillo = new Fillo();
Connection connection = fillo.getConnection("path/to/TestData.xlsx");
String strQuery = "Select * from Sheet1 where ID=101 and Status='Active'";
Recordset recordset = connection.executeQuery(strQuery);
while (recordset.next())
{
System.out.println(recordset.getField("UserName"));
}
recordset.close();
connection.close();Add new rows to your Excel sheet effortlessly.
Connection connection = fillo.getConnection("path/to/TestData.xlsx");
String strQuery = "INSERT INTO Sheet1(Name, Country) VALUES('Gladson', 'India')";
connection.executeUpdate(strQuery);
connection.close();Update specific records using a WHERE clause.
Connection connection = fillo.getConnection("path/to/TestData.xlsx");
String strQuery = "UPDATE Sheet1 SET Status='Passed' where TestCaseID='TC_001'";
connection.executeUpdate(strQuery);
connection.close();Prerequisites
-
Java JDK 8 or later
-
Apache Maven
-
An IDE such as IntelliJ IDEA or Eclipse Setup
-
Clone the repository:
git clone https://github.com/GladsonAntony/Fillo-Examples.git- Import the project as a Maven project in your IDE. Let Maven download the required dependencies
- Data-driven testing using Excel as a lightweight data source
- Test automation frameworks needing simple Excel CRUD operations
- Proof-of-concept projects for Fillo integration
Contributions are welcome! If you have improvements or additional examples:
- Fork the repository
- Create a feature branch
- Commit your changes
- Open a pull request
This project is provided as an example for learning and experimentation purposes. Please refer to the Fillo library’s official license for usage terms.
👤 Author: GladsonAntony
⭐ If you find this repository useful, consider starring it on GitHub
