com.sap.cds.feature.services.db.hana.HanaDataSourceDescriptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cds-feature-hana Show documentation
Show all versions of cds-feature-hana Show documentation
SAP HANA service connectivity feature for CDS Services Java
/**************************************************************************
* (C) 2019-2020 SAP SE or an SAP affiliate company. All rights reserved. *
**************************************************************************/
package com.sap.cds.feature.services.db.hana;
import java.util.Map;
import com.sap.cds.feature.platform.ServiceBinding;
import com.sap.cds.feature.services.db.DataSourceDescriptor;
/**
* Converts a HANA {@link ServiceBinding} into a {@link DataSourceDescriptor}
*/
public class HanaDataSourceDescriptor implements DataSourceDescriptor {
private final String name;
private final String url;
private final String username;
private final String password;
public HanaDataSourceDescriptor(ServiceBinding binding) {
this.name = binding.getServiceInstanceName();
Map credentials = binding.getCredentials();
this.url = (String) credentials.get("url");
this.username = (String) credentials.get("user");
this.password = (String) credentials.get("password");
}
@Override
public String getServiceName() {
return name;
}
@Override
public String getDriverClassName() {
return "com.sap.db.jdbc.Driver";
}
@Override
public String getUrl() {
return url;
}
@Override
public String getUsername() {
return username;
}
@Override
public String getPassword() {
return password;
}
@Override
public boolean isEmbedded() {
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy