Skip to content

Commit

Permalink
dbeaver/dbeaver#23361 Driver definition + connection page
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-rider committed Oct 30, 2024
1 parent acd1760 commit f960ad0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion com.dbeaver.jdbc.driver.libsql/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Connection connect(String url, Properties info) throws SQLException {

Map<String, Object> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f960ad0

Please sign in to comment.