diff --git a/agents/.gitignore b/agents/.gitignore index 9f4a3056c6..014df735db 100644 --- a/agents/.gitignore +++ b/agents/.gitignore @@ -1,6 +1,7 @@ **/libs/*.jar !drivers/cache/libs/CacheDB.jar !drivers/oscar/libs/oscarJDBC8.jar +!drivers/sundb/libs/sundb8-1.0.2.jar !drivers/transwarp/libs/inceptor-sdk-transwarp-6.1.0-SNAPSHOT.jar !drivers/uxdb/libs/uxdbjdbc-2.1.2.3p.jre8.jar gradle.properties diff --git a/agents/docs/release-checklist.md b/agents/docs/release-checklist.md index 2c8297992e..e419e41e20 100644 --- a/agents/docs/release-checklist.md +++ b/agents/docs/release-checklist.md @@ -111,7 +111,9 @@ attributes( - Confirm release registry generation emits `external_driver_required: true`. -Current external-driver agents include BigQuery and SunDB. +Current external-driver agents include BigQuery. SunDB used to carry the flag; +its vendor JAR is now vendored under `drivers/sundb/libs/` and bundled into +the Agent, so it is a normal bundled driver again. ## 6. JRE Selection diff --git a/agents/drivers/sundb/build.gradle b/agents/drivers/sundb/build.gradle index ef14a7312d..1be244d44d 100644 --- a/agents/drivers/sundb/build.gradle +++ b/agents/drivers/sundb/build.gradle @@ -1,4 +1,9 @@ dependencies { + // The vendor ships no Maven-published artifact, so the driver JAR is + // vendored under libs/ (git-whitelisted like cache/gbase8a/oscar/uxdb) and + // bundled into the Agent so SunDB connections work without user setup. + // A newer vendor JAR can still be supplied per connection via + // `jdbc_driver_paths`, which the Agent loads in an isolated URLClassLoader. implementation fileTree(dir: 'libs', include: ['*.jar']) } @@ -6,7 +11,6 @@ tasks.named('shadowJar') { manifest { attributes( 'Agent-Label': 'SunDB', - 'Agent-External-Driver': 'true', 'Main-Class': 'com.dbx.agent.sundb.SundbAgent' ) } diff --git a/agents/drivers/sundb/libs/sundb8-1.0.2.jar b/agents/drivers/sundb/libs/sundb8-1.0.2.jar new file mode 100644 index 0000000000..c140c12f1d Binary files /dev/null and b/agents/drivers/sundb/libs/sundb8-1.0.2.jar differ diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue index 8a5e8e24b7..97ffb7e0ba 100644 --- a/apps/desktop/src/components/connection/ConnectionDialog.vue +++ b/apps/desktop/src/components/connection/ConnectionDialog.vue @@ -90,6 +90,7 @@ import { mysqlCleartextPasswordAuthEnabled, setMysqlCleartextPasswordAuthEnabled import { applyDamengSslUrlParams, damengSslFormConfig } from "@/lib/database/damengSslOptions"; import { DAMENG_BUILTIN_DRIVER_PROFILE, DAMENG_CUSTOM_DRIVER_PROFILE, DAMENG_DEFAULT_JDBC_DRIVER_CLASS, damengCustomJdbcUrl, damengDriverModeForConfig, defaultDamengJdbcUrl, type DamengDriverMode } from "@/lib/database/damengDriverOptions"; import { doltSystemTablesVisible, isDoltDriverProfile, setDoltSystemTablesVisible } from "@/lib/database/doltProfile"; +import { SUNDB_DEFAULT_JDBC_DRIVER_CLASS, sundbJdbcDriverClass } from "@/lib/database/sundbDriverOptions"; import { DamengJvmSystemPropertyError, damengJvmSystemPropertiesText, parseDamengJvmSystemProperties } from "@/lib/database/damengJvmOptions"; import { copyToClipboard } from "@/lib/common/clipboard"; import { configuredDatabaseProductName, connectionConfigFingerprint, databaseInfoCopyText, databaseInfoRows, normalizeDatabaseConnectionInfo, type DatabaseInfoField } from "@/lib/connection/connectionDatabaseInfo"; @@ -2888,6 +2889,15 @@ function applyProfile(val: string, preserveConnectionFields = false) { jdbcDriverPathsInput.value = ""; jdbcManualClasspathOpen.value = true; } + if (profile.type === "sundb") { + // The SunDB Agent bundles the vendor JDBC driver, so the connection works + // without a JAR; the classpath field is only an override for anyone who + // wants the Agent to load a newer vendor JAR in isolation. + form.value.connection_string = undefined; + form.value.jdbc_driver_class = SUNDB_DEFAULT_JDBC_DRIVER_CLASS; + form.value.jdbc_driver_paths = []; + jdbcDriverPathsInput.value = ""; + } if (profile.type === "transwarp") { form.value.connection_string = undefined; } @@ -3097,7 +3107,7 @@ watch( sysdba: config.sysdba || isOracleSysUser(config), oracle_connection_type: config.oracle_connection_type || "service_name", connection_string: config.connection_string, - jdbc_driver_class: config.jdbc_driver_class, + jdbc_driver_class: config.db_type === "sundb" ? sundbJdbcDriverClass(config) : config.jdbc_driver_class, jdbc_driver_paths: config.jdbc_driver_paths || [], redis_connection_mode: config.redis_connection_mode || "standalone", redis_sentinel_master: config.redis_sentinel_master || "", @@ -3597,7 +3607,7 @@ function dbCategoryForOption(value: string): DbCategoryKey | undefined { const selectedDbIcon = computed(() => (isPluginConnection.value ? "plugin" : iconTypeMap[selectedType.value] || selectedProfile().icon || selectedType.value)); function supportsNativeAgentJdbcDriverConfigType(dbType: DatabaseType): boolean { - return dbType === "prestosql" || dbType === "bigquery" || dbType === "dameng"; + return dbType === "prestosql" || dbType === "bigquery" || dbType === "dameng" || dbType === "sundb"; } const jdbcBackedDatabaseTypes = new Set(["jdbc", "prestosql", "bigquery"]); @@ -3613,6 +3623,11 @@ const jdbcxHighPrivilegeExtensionsAllowed = computed({ }, }); const supportsNativeAgentJdbcDriverConfig = computed(() => supportsNativeAgentJdbcDriverConfigType(form.value.db_type) && (form.value.db_type !== "dameng" || isDamengCustomDriver.value)); +const nativeAgentJdbcDriverHint = computed(() => { + if (form.value.db_type === "dameng") return t("connection.damengCustomDriverHint"); + if (form.value.db_type === "sundb") return t("connection.sundbCustomDriverHint"); + return t("connection.jdbcPluginHint"); +}); const isH2FileMode = computed(() => form.value.db_type === "h2" && h2ConnectionMode.value === "file"); const isH2CustomDriver = computed(() => form.value.db_type === "h2" && form.value.driver_profile === "h2-custom"); const usesLocalFilePathInput = computed(() => isLocalFileTypeDb(form.value.db_type) && (form.value.db_type !== "h2" || isH2FileMode.value)); @@ -5073,6 +5088,13 @@ function connectionConfigForSubmit(id: string, generatedName = "", validatePlugi config.jdbc_driver_paths = []; } } + if (config.db_type === "sundb") { + // The SunDB Agent bundles the vendor driver; an empty classpath means the + // Agent resolves the driver class on its own classloader. A non-empty + // classpath still overrides it with a user-supplied JAR. + config.jdbc_driver_class = sundbJdbcDriverClass(config); + config.jdbc_driver_paths = parsedJdbcDriverPaths(); + } if (jdbcBackedDatabaseTypes.has(config.db_type) || gaussdbConnectionMode(config) === "m-jdbc") { if (config.db_type === "jdbc") { if (config.driver_profile === "dremio") { @@ -9155,7 +9177,7 @@ function openExternalUrl(url: string) {

- {{ form.db_type === "dameng" ? t("connection.damengCustomDriverHint") : t("connection.jdbcPluginHint") }} + {{ nativeAgentJdbcDriverHint }}