From 2b10b1336de8793ab8824ca72337a22ef628c7db Mon Sep 17 00:00:00 2001
From: gmantele <gmantele@ari.uni-heidelberg.de>
Date: Tue, 10 Mar 2015 17:02:02 +0100
Subject: [PATCH] [TAP] Default TAPSchema DB name set to the ADQL name ; so if
 the column TAP_SCHEMA.schemas.dbname is NULL or empty, the DB name must be
 set to the ADQL name. For the moment no empty schema is allowed.

---
 src/tap/db/JDBCConnection.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tap/db/JDBCConnection.java b/src/tap/db/JDBCConnection.java
index 87eed3b..0ea1653 100644
--- a/src/tap/db/JDBCConnection.java
+++ b/src/tap/db/JDBCConnection.java
@@ -546,7 +546,8 @@ public class JDBCConnection implements DBConnection {
 
 				// create the new schema:
 				TAPSchema newSchema = new TAPSchema(schemaName, nullifyIfNeeded(description), nullifyIfNeeded(utype));
-				newSchema.setDBName(dbName);
+				if (dbName != null && dbName.trim().length() > 0)
+					newSchema.setDBName(dbName);
 
 				// add the new schema inside the given metadata:
 				metadata.addSchema(newSchema);
-- 
GitLab