-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGetColumnsCount.java
More file actions
27 lines (20 loc) · 809 Bytes
/
Copy pathGetColumnsCount.java
File metadata and controls
27 lines (20 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package allTests;
import java.net.URL;
import java.util.ArrayList;
import com.codoid.products.exception.FilloException;
import com.codoid.products.fillo.Connection;
import com.codoid.products.fillo.Fillo;
import com.codoid.products.fillo.Recordset;
public class GetColumnsCount {
public static void main(String[] args) throws FilloException {
Fillo fillo=new Fillo();
URL path = GetColumnsCount.class.getResource("sample.xlsx");
Connection connection=fillo.getConnection(path.getFile());
String strQuery="Select * from TC_Data";
Recordset recordset=connection.executeQuery(strQuery).where("TestCase='TC1'");
ArrayList<String> columnLength = recordset.getFieldNames();
System.out.println("Column Count is : "+ (columnLength.size()));
recordset.close();
connection.close();
}
}