Implement getURL() for JDBC4DatabaseMetaData

This commit is contained in:
김선우
2025-02-09 10:49:06 +09:00
parent f6bd58e7a4
commit ea02664f68
4 changed files with 40 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ import org.github.tursodatabase.utils.LoggerFactory;
public class LimboConnection {
private static final Logger logger = LoggerFactory.getLogger(LimboConnection.class);
private final String url;
private final long connectionPtr;
private final AbstractDB database;
private boolean closed;
@@ -28,6 +29,7 @@ public class LimboConnection {
* @param filePath path to file
*/
public LimboConnection(String url, String filePath, Properties properties) throws SQLException {
this.url = url;
this.database = open(url, filePath, properties);
this.connectionPtr = this.database.connect();
}
@@ -41,6 +43,10 @@ public class LimboConnection {
if (isClosed()) throw new SQLException("database connection closed");
}
public String getUrl() {
return url;
}
public void close() throws SQLException {
if (isClosed()) {
return;

View File

@@ -368,4 +368,8 @@ public class JDBC4Connection implements Connection {
// TODO: add support for busyTimeout
return 0;
}
public String getUrl() {
return this.connection.getUrl();
}
}

View File

@@ -28,7 +28,7 @@ public class JDBC4DatabaseMetaData implements DatabaseMetaData {
@Override
public String getURL() throws SQLException {
return "";
return connection.getUrl();
}
@Override
@@ -786,6 +786,7 @@ public class JDBC4DatabaseMetaData implements DatabaseMetaData {
}
@Override
@SkipNullableCheck
public Connection getConnection() throws SQLException {
return null;
}