matthiasblaesing commented on code in PR #8189:
URL: https://github.com/apache/netbeans/pull/8189#discussion_r2426768204
##########
ide/db/src/org/netbeans/modules/db/util/DriverListUtil.java:
##########
@@ -376,17 +381,42 @@ following fully-qualified class names (FQCNs) that are
independent of the JDBC v
add("Sybase Driver",
"com.sun.sql.jdbc.sybase.SybaseDriver",
- "jdbc:sun:sybase://<HOST>[:<PORT]");
+ "jdbc:sun:sybase://<HOST>[:<PORT>]");
- add("SQLite",
- "org.sqlite.JDBC",
- "jdbc:sqlite:<FILE>");
-
- add("H2 Database Engine",
+ url = add("SQLite", null, "org.sqlite.JDBC", "jdbc:sqlite:<FILE>",
true);
+ url.setSampleUrl("jdbc:sqlite:");
+ url.setUsernamePasswordDisplayed(false);
+ url.setDatabaseFileValidator(new SQLiteDatabaseFileValidator());
+
+ // The FILE field is optional for DuckDB. If omitted, an in-memory
database will be opened.
+ url = add("DuckDB", null, "org.duckdb.DuckDBDriver",
"jdbc:duckdb:[<FILE>]", true);
+ url.setSampleUrl("jdbc:duckdb:");
+ url.setUsernamePasswordDisplayed(false);
+ url.setDatabaseFileValidator(new DuckDBDatabaseFileValidator());
+
+ url = add("H2 Database Engine",
"org.h2.Driver",
- "jdbc:h2:<FILE>");
+ "jdbc:h2:<FILE>", true);
Review Comment:
For h2 this is not correct. The extension of the DB file not part of the
URL. So if you have db file `/path/to/db/demo.mv.db` the jdbc URL will be
`jdbc:h2:/path/to/db/demo` (yes that is ugly).
##########
ide/db/src/org/netbeans/modules/db/util/DriverListUtil.java:
##########
@@ -404,6 +434,8 @@ public static List<JdbcUrl> getJdbcUrls(JDBCDriver driver) {
for (JdbcUrl url : templateUrls) {
if (url.getClassName().equals(driver.getClassName())) {
JdbcUrl newurl = new JdbcUrl(url, driver);
+
newurl.setUsernamePasswordDisplayed(url.isUsernamePasswordDisplayed());
+
newurl.setDatabaseFileValidator(url.getDatabaseFileValidator());
Review Comment:
Wouldn't it make sense to transfer the values inside the `JdbcUrl`
constructor?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists