Accessing remote Excel data sheets through JDBC connects successfully in case of wrong credential

121 views Asked by At

I am connecting to remote excel file using jdbc driver:

Class.forName(JDBC_DRIVER);
        System.out.println("Connecting to database...");
        conn = DriverManager.getConnection("jdbc:excel:smb://username:pass@host/path/Data.xlsx");
        System.out.println("Connected to " + "url" + " successfully");

It works fine, but when I enter wrong username/password it connects successfully too. How should I implement it to get exception when connecting with wrong credentials?

0

There are 0 answers