diff --git a/com.dbeaver.jdbc.driver.libsql/META-INF/MANIFEST.MF b/com.dbeaver.jdbc.driver.libsql/META-INF/MANIFEST.MF index 16564c2..64ce578 100644 --- a/com.dbeaver.jdbc.driver.libsql/META-INF/MANIFEST.MF +++ b/com.dbeaver.jdbc.driver.libsql/META-INF/MANIFEST.MF @@ -5,7 +5,8 @@ Bundle-SymbolicName: com.dbeaver.jdbc.driver.libsql Bundle-Version: 1.0.1.qualifier Bundle-Release-Date: 20230522 Bundle-RequiredExecutionEnvironment: JavaSE-17 -Export-Package: com.dbeaver.jdbc.libsql +Export-Package: com.dbeaver.jdbc.driver.libsql, + com.dbeaver.jdbc.driver.libsql.client Require-Bundle: com.dbeaver.jdbc.api, com.dbeaver.rpc, org.jkiss.utils, diff --git a/com.dbeaver.jdbc.driver.libsql/src/main/java/com/dbeaver/jdbc/driver/libsql/LibSqlDriver.java b/com.dbeaver.jdbc.driver.libsql/src/main/java/com/dbeaver/jdbc/driver/libsql/LibSqlDriver.java index 8c67158..d30c82c 100644 --- a/com.dbeaver.jdbc.driver.libsql/src/main/java/com/dbeaver/jdbc/driver/libsql/LibSqlDriver.java +++ b/com.dbeaver.jdbc.driver.libsql/src/main/java/com/dbeaver/jdbc/driver/libsql/LibSqlDriver.java @@ -44,7 +44,7 @@ public Connection connect(String url, Properties info) throws SQLException { Map props = new LinkedHashMap<>(); for (Enumeration pne = info.propertyNames(); pne.hasMoreElements(); ) { - String propName = pne.toString(); + String propName = (String) pne.nextElement(); props.put(propName, info.get(propName)); } return new LibSqlConnection(this, targetUrl, props); diff --git a/com.dbeaver.jdbc.driver.libsql/src/main/java/com/dbeaver/jdbc/driver/libsql/client/LibSqlClient.java b/com.dbeaver.jdbc.driver.libsql/src/main/java/com/dbeaver/jdbc/driver/libsql/client/LibSqlClient.java index 377df29..0fced4e 100644 --- a/com.dbeaver.jdbc.driver.libsql/src/main/java/com/dbeaver/jdbc/driver/libsql/client/LibSqlClient.java +++ b/com.dbeaver.jdbc.driver.libsql/src/main/java/com/dbeaver/jdbc/driver/libsql/client/LibSqlClient.java @@ -74,6 +74,14 @@ public LibSqlExecutionResult[] executeBatch( resultSets[i] = response[i].results; } return resultSets; + } catch (IOException e) { + switch (conn.getResponseCode()) { + case HttpURLConnection.HTTP_UNAUTHORIZED -> + throw new SQLException("Authentication required", e); + case HttpURLConnection.HTTP_FORBIDDEN -> + throw new SQLException("Access denied", e); + } + throw e; } } catch (IOException e) { throw new SQLException(e);