i want to run sql queries on Microsoft excel, so that i can fetch any row or any column based on the sql query. Below is the code which i have written
Connection con = null;
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:Driver={Microsoft Excel Driver(*.xls)};DBQ="+path+"; ReadOnly=0");`
// Here path is the path to the excel file in my local.
When i run this i am getting invalid oracle URL specified error. I have a doubt on the URL format that i need to specify for querying excel sheets. Is there any other way to read excel sheet using sql queries without using DSN.
java.sql.SQLException: Invalid Oracle URL specified
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:191)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:287)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:550)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)