Skip to content

Commit

Permalink
Remove port number from teradata connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
Jithendar12 committed Dec 3, 2024
1 parent 8a43a53 commit 1979de0
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,28 @@

import com.amazonaws.athena.connectors.jdbc.JdbcEnvironmentProperties;

import java.util.HashMap;
import java.util.Map;

import static com.amazonaws.athena.connector.lambda.connection.EnvironmentConstants.DATABASE;
import static com.amazonaws.athena.connector.lambda.connection.EnvironmentConstants.DEFAULT;
import static com.amazonaws.athena.connector.lambda.connection.EnvironmentConstants.HOST;

public class TeradataEnvironmentProperties extends JdbcEnvironmentProperties
{
@Override
public Map<String, String> connectionPropertiesToEnvironment(Map<String, String> connectionProperties)
{
HashMap<String, String> environment = new HashMap<>();

// construct jdbc string without port number
String connectionString = getConnectionStringPrefix(connectionProperties) + connectionProperties.get(HOST)
+ getDatabase(connectionProperties) + getJdbcParameters(connectionProperties);

environment.put(DEFAULT, connectionString);
return environment;
}

@Override
protected String getConnectionStringPrefix(Map<String, String> connectionProperties)
{
Expand Down

0 comments on commit 1979de0

Please sign in to comment.