diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerProject.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerProject.java index cf601dae8c..7500c25460 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerProject.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerProject.java @@ -20,7 +20,6 @@ import org.jkiss.code.NotNull; import org.jkiss.code.Nullable; import org.jkiss.dbeaver.DBException; -import org.jkiss.dbeaver.Log; import org.jkiss.dbeaver.model.DBIcon; import org.jkiss.dbeaver.model.DBPImage; import org.jkiss.dbeaver.model.DBPObject; @@ -37,7 +36,6 @@ import java.util.List; public class DBNResourceManagerProject extends DBNAbstractResourceManagerNode { - private static final Log log = Log.getLog(DBNResourceManagerProject.class); private final RMProject project; @@ -123,24 +121,18 @@ public DBNNode refreshNode(DBRProgressMonitor monitor, Object source) throws DBE return this; } - @Override - public String toString() { - return getNodeDisplayName(); - } - - + @NotNull @Override public DBPProject getOwnerProject() { List globalProjects = getModel().getModelProjects(); - if (globalProjects == null) { - return null; - } - for (DBPProject modelProject : globalProjects) { - if (CommonUtils.equalObjects(modelProject.getId(), project.getId())) { - return modelProject; + if (globalProjects != null) { + for (DBPProject modelProject : globalProjects) { + if (CommonUtils.equalObjects(modelProject.getId(), project.getId())) { + return modelProject; + } } } - return null; + throw new IllegalStateException("Project '" + project.getId() + "' not found in workspace"); } @Nullable @@ -148,4 +140,10 @@ public DBPProject getOwnerProject() { public DBPObject getObjectDetails(@NotNull DBRProgressMonitor monitor, @NotNull SMSessionContext sessionContext, @NotNull Object dataSource) throws DBException { return project; } + + @Override + public String toString() { + return getNodeDisplayName(); + } + } diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerResource.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerResource.java index 30919d34ca..0fdc50e6e4 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerResource.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/DBNResourceManagerResource.java @@ -203,6 +203,7 @@ public DBPObject getObjectDetails(@NotNull DBRProgressMonitor monitor, @NotNull return resource; } + @NotNull @Override public DBPProject getOwnerProject() { return getParentNode().getOwnerProject(); diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebSessionWorkspace.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebSessionWorkspace.java index f1a86e49c4..f24bf8c90a 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebSessionWorkspace.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebSessionWorkspace.java @@ -19,6 +19,8 @@ import io.cloudbeaver.WebProjectImpl; import org.jkiss.code.NotNull; import org.jkiss.code.Nullable; +import org.jkiss.dbeaver.model.DBPAdaptable; +import org.jkiss.dbeaver.model.DBPImage; import org.jkiss.dbeaver.model.app.DBPPlatform; import org.jkiss.dbeaver.model.app.DBPProject; import org.jkiss.dbeaver.model.app.DBPWorkspace; @@ -132,6 +134,11 @@ public void dispose() { clearProjects(); } + @Override + public DBPImage getResourceIcon(DBPAdaptable resourceAdapter) { + return null; + } + public void setActiveProject(DBPProject activeProject) { this.activeProject = (WebProjectImpl) activeProject; } diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/navigator/WebNavigatorNodeInfo.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/navigator/WebNavigatorNodeInfo.java index 18bf967868..6e31e3113e 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/navigator/WebNavigatorNodeInfo.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/navigator/WebNavigatorNodeInfo.java @@ -111,7 +111,7 @@ public String getPlainName() { // for renaming node @Property public String getProjectId() { - DBPProject ownerProject = node.getOwnerProject(); + DBPProject ownerProject = node.getOwnerProjectOrNull(); return ownerProject == null ? null : ownerProject.getId(); } @@ -119,11 +119,11 @@ public String getProjectId() { @Deprecated public String getFullName() { String nodeName; - if (node instanceof DBNDatabaseNode && !(node instanceof DBNDataSource)) { - DBSObject object = ((DBNDatabaseNode) node).getObject(); + if (node instanceof DBNDatabaseNode dbNode && !(node instanceof DBNDataSource)) { + DBSObject object = dbNode.getObject(); nodeName = DBUtils.getObjectFullName(object, DBPEvaluationContext.UI); - } else if (node instanceof DBNDataSource) { - DBPDataSourceContainer object = ((DBNDataSource) node).getDataSourceContainer(); + } else if (node instanceof DBNDataSource dataSource) { + DBPDataSourceContainer object = dataSource.getDataSourceContainer(); nodeName = object.getName(); } else { nodeName = node.getNodeTargetName(); @@ -235,7 +235,7 @@ public String[] getFeatures() { if (objectManager != null && objectManager.canDeleteObject(object)) { features.add(NODE_FEATURE_CAN_DELETE); } - if (objectManager instanceof DBEObjectRenamer && ((DBEObjectRenamer) objectManager).canRenameObject(object)) { + if (objectManager instanceof DBEObjectRenamer renamer && renamer.canRenameObject(object)) { if (!object.getDataSource().getContainer().getNavigatorSettings().isShowOnlyEntities()) { features.add(NODE_FEATURE_CAN_RENAME); } @@ -282,9 +282,10 @@ private boolean isDistributedSpecialFolderNode() { @Property public WebPropertyInfo[] getNodeDetails() throws DBWebException { - if (node instanceof DBPObjectWithDetails) { + if (node instanceof DBPObjectWithDetails objectWithDetails) { try { - DBPObject objectDetails = ((DBPObjectWithDetails) node).getObjectDetails(session.getProgressMonitor(), session.getSessionContext(), node); + DBPObject objectDetails = objectWithDetails.getObjectDetails( + session.getProgressMonitor(), session.getSessionContext(), node); if (objectDetails != null) { return WebServiceUtils.getObjectProperties(session, objectDetails); } @@ -301,8 +302,8 @@ public WebPropertyInfo[] getNodeDetails() throws DBWebException { @Property public WebDatabaseObjectInfo getObject() { - if (node instanceof DBNDatabaseNode) { - DBSObject object = ((DBNDatabaseNode) node).getObject(); + if (node instanceof DBNDatabaseNode dbNode) { + DBSObject object = dbNode.getObject(); return object == null ? null : new WebDatabaseObjectInfo(session, object); } return null; @@ -320,10 +321,10 @@ public String getObjectId() { @Property public DBSObjectFilter getFilter() throws DBWebException { - if (!(node instanceof DBNDatabaseNode)) { + if (!(node instanceof DBNDatabaseNode dbNode)) { throw new DBWebException("Invalid navigator node type: " + node.getClass().getName()); } - DBSObjectFilter filter = ((DBNDatabaseNode) node).getNodeFilter(((DBNDatabaseNode) node).getItemsMeta(), true); + DBSObjectFilter filter = dbNode.getNodeFilter(dbNode.getItemsMeta(), true); return filter == null || filter.isEmpty() || !filter.isEnabled() ? null : filter; } diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/navigator/impl/WebServiceNavigator.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/navigator/impl/WebServiceNavigator.java index 28f54520c8..96690ea4de 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/navigator/impl/WebServiceNavigator.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/navigator/impl/WebServiceNavigator.java @@ -228,11 +228,12 @@ public boolean setNavigatorNodeFilter( filter.setExclude(exclude); } filter.setEnabled(true); - ((DBNDatabaseNode) node).setNodeFilter( - ((DBNDatabaseNode) node).getItemsMeta(), filter, true); - if (hasNodeEditPermission(webSession, node, ((WebProjectImpl) node.getOwnerProject()).getRmProject())) { - // Save settings - ((DBNDatabaseNode) node).getDataSourceContainer().persistConfiguration(); + if (node instanceof DBNDatabaseNode dbNode) { + dbNode.setNodeFilter(dbNode.getItemsMeta(), filter, true); + if (hasNodeEditPermission(webSession, node, ((WebProjectImpl) node.getOwnerProject()).getRmProject())) { + // Save settings + dbNode.getDataSourceContainer().persistConfiguration(); + } } } catch (DBException e) { if (e instanceof DBWebException) { @@ -255,14 +256,14 @@ public boolean refreshNavigatorNode( if (node == null) { throw new DBWebException("Navigator node '" + nodePath + "' not found"); } - if (node instanceof DBNDataSource) { + if (node instanceof DBNDataSource dbnDataSource) { // Do not refresh entire tree - just clear child nodes // Otherwise refresh may fail if navigator settings were changed. - DBPDataSource dataSource = ((DBNDataSource) node).getDataSource(); - if (dataSource instanceof DBPRefreshableObject) { - ((DBPRefreshableObject) dataSource).refreshObject(monitor); + DBPDataSource dataSource = dbnDataSource.getDataSource(); + if (dataSource instanceof DBPRefreshableObject refreshableObject) { + refreshableObject.refreshObject(monitor); } - ((DBNDataSource) node).cleanupNode(); + dbnDataSource.cleanupNode(); } else if (node instanceof DBNLocalFolder) { // Refresh can't be applied to the local folder node return true; @@ -425,7 +426,7 @@ private String renameConnectionFolder(@NotNull WebSession session, DBNNode node, List siblings = Arrays.stream( ((DBNLocalFolder) node).getLogicalParent().getChildren(session.getProgressMonitor())) .filter(n -> n instanceof DBNLocalFolder) - .map(DBNNode::getName).collect(Collectors.toList()); + .map(DBNNode::getName).toList(); if (siblings.contains(newName)) { throw new DBWebException("Name " + newName + " is unavailable or invalid"); } diff --git a/server/bundles/io.cloudbeaver.service.security/src/io/cloudbeaver/service/security/CBEmbeddedSecurityController.java b/server/bundles/io.cloudbeaver.service.security/src/io/cloudbeaver/service/security/CBEmbeddedSecurityController.java index 7b21ede7fb..c8887edeed 100644 --- a/server/bundles/io.cloudbeaver.service.security/src/io/cloudbeaver/service/security/CBEmbeddedSecurityController.java +++ b/server/bundles/io.cloudbeaver.service.security/src/io/cloudbeaver/service/security/CBEmbeddedSecurityController.java @@ -515,7 +515,7 @@ public SMUser[] findUsers(@NotNull SMUserFilter filter) try (PreparedStatement dbStat = dbCon.prepareStatement( database.normalizeTableNames("SELECT USER_ID,IS_ACTIVE,DEFAULT_AUTH_ROLE FROM {table_prefix}CB_USER" + buildUsersFilter(filter) + "\nORDER BY USER_ID " + getOffsetLimitPart(filter)))) { - int parameterIndex = setUsersFilterValues(dbStat, filter, 1); + setUsersFilterValues(dbStat, filter, 1); try (ResultSet dbResult = dbStat.executeQuery()) { while (dbResult.next()) { @@ -531,14 +531,11 @@ public SMUser[] findUsers(@NotNull SMUserFilter filter) } readSubjectsMetas(dbCon, SMSubjectType.user, filter.getUserIdMask(), result); - StringBuilder teamsSql = new StringBuilder() - .append("SELECT USER_ID,TEAM_ID FROM {table_prefix}CB_USER_TEAM") - .append("\n") - .append("WHERE USER_ID IN (") - .append(SQLUtils.generateParamList(result.size())) - .append(")"); + String teamsSql = + "SELECT USER_ID,TEAM_ID FROM {table_prefix}CB_USER_TEAM\n" + + "WHERE USER_ID IN (" + SQLUtils.generateParamList(result.size()) + ")"; // Read teams - try (PreparedStatement dbStat = dbCon.prepareStatement(database.normalizeTableNames(teamsSql.toString()))) { + try (PreparedStatement dbStat = dbCon.prepareStatement(database.normalizeTableNames(teamsSql))) { int parameterIndex = 1; for (String userId : result.keySet()) { dbStat.setString(parameterIndex++, userId); @@ -574,7 +571,7 @@ private String buildUsersFilter(SMUserFilter filter) { if (filter.getEnabledState() != null) { whereParts.add("IS_ACTIVE=?"); } - if (whereParts.size() > 0) { + if (!whereParts.isEmpty()) { where.append(whereParts.stream().collect(Collectors.joining(" AND ", " WHERE ", ""))); } return where.toString(); @@ -858,7 +855,7 @@ public void setUserCredentials( String encodedValue = CommonUtils.toString(cred.getValue()); encodedValue = property.getEncryption().encrypt(userId, encodedValue); return new String[]{propertyName, encodedValue}; - }).collect(Collectors.toList()); + }).toList(); } catch (Exception e) { throw new DBCException(e.getMessage(), e); } @@ -1037,7 +1034,7 @@ public String[] getUserLinkedProviders(@NotNull String userId) throws DBExceptio @NotNull @Override - public SMPropertyDescriptor[] getMetaParametersBySubjectType(SMSubjectType subjectType) throws DBException { + public SMPropertyDescriptor[] getMetaParametersBySubjectType(SMSubjectType subjectType) { // First add global metas List props = new ArrayList<>( WebMetaParametersRegistry.getInstance().getMetaParameters(subjectType)); @@ -1083,9 +1080,11 @@ public SMTeam[] readAllTeams() throws DBCException { } } } - query = database.normalizeTableNames("SELECT SUBJECT_ID,PERMISSION_ID\n" + - "FROM {table_prefix}CB_AUTH_PERMISSIONS AP, {table_prefix}CB_TEAM R\n" + - "WHERE AP.SUBJECT_ID IN (R.TEAM_ID,?)\n"); + query = database.normalizeTableNames(""" + SELECT SUBJECT_ID,PERMISSION_ID + FROM {table_prefix}CB_AUTH_PERMISSIONS AP, {table_prefix}CB_TEAM R + WHERE AP.SUBJECT_ID IN (R.TEAM_ID,?) + """); try (PreparedStatement dbPreparedStatement = dbCon.prepareStatement(query)) { dbPreparedStatement.setString(1, defaultUserTeam); try (ResultSet dbResult = dbPreparedStatement.executeQuery()) { @@ -1422,7 +1421,7 @@ private String createSmSession( @NotNull Map parameters, @NotNull SMSessionType sessionType, Connection dbCon - ) throws SQLException, DBException { + ) throws SQLException { var sessionId = UUID.randomUUID().toString(); try (PreparedStatement dbStat = dbCon.prepareStatement( database.normalizeTableNames( @@ -1754,11 +1753,10 @@ private void updateAuthStatus( SMAuthConfigurationReference providerId = entry.getKey(); String authJson = gson.toJson(entry.getValue()); boolean configIdExist = providerId.getAuthProviderConfigurationId() != null; - var sqlBuilder = new StringBuilder(); - sqlBuilder.append("UPDATE {table_prefix}CB_AUTH_ATTEMPT_INFO SET AUTH_STATE=? ") - .append("WHERE AUTH_ID=? AND AUTH_PROVIDER_ID=? AND ") - .append(configIdExist ? "AUTH_PROVIDER_CONFIGURATION_ID=?" : "AUTH_PROVIDER_CONFIGURATION_ID IS NULL"); - try (PreparedStatement dbStat = dbCon.prepareStatement(database.normalizeTableNames(sqlBuilder.toString()))) { + String sqlBuilder = "UPDATE {table_prefix}CB_AUTH_ATTEMPT_INFO SET AUTH_STATE=? " + + "WHERE AUTH_ID=? AND AUTH_PROVIDER_ID=? AND " + + (configIdExist ? "AUTH_PROVIDER_CONFIGURATION_ID=?" : "AUTH_PROVIDER_CONFIGURATION_ID IS NULL"); + try (PreparedStatement dbStat = dbCon.prepareStatement(database.normalizeTableNames(sqlBuilder))) { dbStat.setString(1, authJson); dbStat.setString(2, authId); dbStat.setString(3, providerId.getAuthProviderId()); @@ -1848,16 +1846,14 @@ private SMAuthInfo getAuthStatus(@NotNull String authId, boolean readExpiredData if (authProviderConfiguration != null) { WebAuthProviderDescriptor authProviderDescriptor = getAuthProvider(authProviderId); var authProviderInstance = authProviderDescriptor.getInstance(); - if (SMAuthProviderFederated.class.isAssignableFrom(authProviderInstance.getClass())) { - signInLink = buildRedirectLink(((SMAuthProviderFederated) authProviderInstance).getRedirectLink( + if (authProviderInstance instanceof SMAuthProviderFederated providerFederated) { + signInLink = buildRedirectLink(providerFederated.getRedirectLink( authProviderConfiguration, Map.of()), authId); - var userCustomSignOutLink = - ((SMAuthProviderFederated) authProviderInstance).getUserSignOutLink( - application.getAuthConfiguration() - .getAuthProviderConfiguration(authProviderConfiguration), - authProviderData); - signOutLink = userCustomSignOutLink; + signOutLink = providerFederated.getUserSignOutLink( + application.getAuthConfiguration() + .getAuthProviderConfiguration(authProviderConfiguration), + authProviderData); } } @@ -1867,16 +1863,13 @@ private SMAuthInfo getAuthStatus(@NotNull String authId, boolean readExpiredData } if (smAuthStatus != SMAuthStatus.SUCCESS) { - switch (smAuthStatus) { - case IN_PROGRESS: - return SMAuthInfo.inProgress(authId, signInLink, signOutLink, authData, isMainAuth, forceSessionsLogout); - case ERROR: - return SMAuthInfo.error(authId, authError, isMainAuth, errorCode); - case EXPIRED: - return SMAuthInfo.expired(authId, readExpiredData ? authData : Map.of(), isMainAuth); - default: - throw new SMException("Unknown auth status:" + smAuthStatus); - } + return switch (smAuthStatus) { + case IN_PROGRESS -> + SMAuthInfo.inProgress(authId, signInLink, signOutLink, authData, isMainAuth, forceSessionsLogout); + case ERROR -> SMAuthInfo.error(authId, authError, isMainAuth, errorCode); + case EXPIRED -> SMAuthInfo.expired(authId, readExpiredData ? authData : Map.of(), isMainAuth); + default -> throw new SMException("Unknown auth status:" + smAuthStatus); + }; } SMTokens smTokens = findTokenBySmSession(smSessionId); @@ -2260,10 +2253,9 @@ private void autoUpdateUserTeams( String userId, SMTeam[] allTeams ) throws DBCException { - if (!(authProvider.getInstance() instanceof SMAuthProviderAssigner)) { + if (!(authProvider.getInstance() instanceof SMAuthProviderAssigner authProviderAssigner)) { return; } - SMAuthProviderAssigner authProviderAssigner = (SMAuthProviderAssigner) authProvider.getInstance(); String externalTeamIdMetadataFieldName = authProviderAssigner.getExternalTeamIdMetadataFieldName(); if (!CommonUtils.isEmpty(externalTeamIdMetadataFieldName)) { @@ -2584,7 +2576,7 @@ private SMAuthPermissions getTokenPermissions(@NotNull String token) throws DBEx try (Connection dbCon = database.openConnection(); PreparedStatement dbStat = dbCon.prepareStatement( database.normalizeTableNames("SELECT USER_ID, EXPIRATION_TIME, SESSION_ID, AUTH_ROLE FROM {table_prefix}CB_AUTH_TOKEN " + - "WHERE TOKEN_ID=?")); + "WHERE TOKEN_ID=?")) ) { dbStat.setString(1, token); try (var dbResult = dbStat.executeQuery()) { @@ -2608,17 +2600,16 @@ private SMAuthPermissions getTokenPermissions(@NotNull String token) throws DBEx @Override public SMAuthProviderDescriptor[] getAvailableAuthProviders() throws DBException { - if (!(application.getAppConfiguration() instanceof WebAuthConfiguration)) { + if (!(application.getAppConfiguration() instanceof WebAuthConfiguration appConfiguration)) { throw new DBException("Web application doesn't support external authentication"); } - WebAuthConfiguration appConfiguration = (WebAuthConfiguration) application.getAppConfiguration(); Set customConfigurations = appConfiguration.getAuthCustomConfigurations(); List providers = WebAuthProviderRegistry.getInstance().getAuthProviders().stream() .filter(ap -> !ap.isTrusted() && appConfiguration.isAuthProviderEnabled(ap.getId()) && (!ap.isConfigurable() || hasProviderConfiguration(ap, customConfigurations))) - .map(WebAuthProviderDescriptor::createDescriptorBean).collect(Collectors.toList()); + .map(WebAuthProviderDescriptor::createDescriptorBean).toList(); if (!CommonUtils.isEmpty(customConfigurations)) { // Attach custom configs to providers @@ -3009,12 +3000,12 @@ public List getObjectPermissionGrants( var grantedPermissionsBySubjectId = new HashMap(); try (Connection dbCon = database.openConnection()) { try (PreparedStatement dbStat = dbCon.prepareStatement(database.normalizeTableNames( - "SELECT OP.SUBJECT_ID,S.SUBJECT_TYPE, OP.PERMISSION\n" + - "FROM {table_prefix}CB_OBJECT_PERMISSIONS OP, {table_prefix}CB_AUTH_SUBJECT S\n" + - "WHERE S.SUBJECT_ID = OP.SUBJECT_ID AND OP.OBJECT_TYPE=? AND OP.OBJECT_ID=?"))) { + """ + SELECT OP.SUBJECT_ID,S.SUBJECT_TYPE, OP.PERMISSION + FROM {table_prefix}CB_OBJECT_PERMISSIONS OP, {table_prefix}CB_AUTH_SUBJECT S + WHERE S.SUBJECT_ID = OP.SUBJECT_ID AND OP.OBJECT_TYPE=? AND OP.OBJECT_ID=?"""))) { dbStat.setString(1, smObjectType.name()); dbStat.setString(2, objectId); - List result = new ArrayList<>(); try (ResultSet dbResult = dbStat.executeQuery()) { while (dbResult.next()) { String subjectId = dbResult.getString(1); @@ -3211,11 +3202,10 @@ public void clearOldAuthAttemptInfo() throws DBException { public Set getFilteredSubjects(Set allSubjects) { try (Connection dbCon = database.openConnection()) { Set result = new HashSet<>(); - var sqlBuilder = new StringBuilder("SELECT SUBJECT_ID FROM {table_prefix}CB_AUTH_SUBJECT U ") - .append("WHERE SUBJECT_ID IN (") - .append(SQLUtils.generateParamList(allSubjects.size())) - .append(")"); - try (var dbStat = dbCon.prepareStatement(database.normalizeTableNames(sqlBuilder.toString()))) { + String sqlBuilder = + "SELECT SUBJECT_ID FROM {table_prefix}CB_AUTH_SUBJECT U " + + "WHERE SUBJECT_ID IN (" + SQLUtils.generateParamList(allSubjects.size()) + ")"; + try (var dbStat = dbCon.prepareStatement(database.normalizeTableNames(sqlBuilder))) { int parameterIndex = 1; for (String subjectId : allSubjects) { dbStat.setString(parameterIndex++, subjectId); @@ -3235,7 +3225,6 @@ public Set getFilteredSubjects(Set allSubjects) { private SMSubjectType getSubjectType(@NotNull String subjectId) { try (Connection dbCon = database.openConnection()) { - Set result = new HashSet<>(); String sqlBuilder = "SELECT SUBJECT_TYPE FROM {table_prefix}CB_AUTH_SUBJECT U WHERE SUBJECT_ID = ?"; try (var dbStat = dbCon.prepareStatement(database.normalizeTableNames(sqlBuilder))) { dbStat.setString(1, subjectId);