Is there a PLATFORM INDEPENDENT connection string for EXCEL file in java. jdbc:odbc is platform dependent. Is there anything else ??
1 Answer
In this post you could see an example of using a connection string without the ODBC. I suppose this is what you are looking for...
Class.forName("com.hxtt.sql.excel.ExcelDriver").newInstance();
String url = "jdbc:Excel:///E:/JavaWithExcel/Feedback.xlsx";
String sql = "select * from [Sheet1]";
Connection con = DriverManager.getConnection(url, "", "");
Statement stmt = con.createStatement();
System.out.println(con);
System.out.println(stmt);
stmt.close();
con.close();
Anyway, you have to understand that the connection string is always specific to the underlying environment. It could depend on the operating system, on the file system or something else... I would just use different configuration files for each environment.
Hope I helped!
1 Comment
Kevin Panko
Please include a brief description in your answer of what the link is telling us. Suppose the link were offline or changed, then we would have no idea what you are telling us.