List of usage examples for com.amazonaws.services.redshift.model Endpoint getPort
public Integer getPort()
The port that the database engine is listening on.
From source file:com.amazon.services.awsrum.utils.RedshiftUtils.java
License:Open Source License
/** * Helper method to convert a Redshift {@link Endpoint} and database name to JDBC connection * String//from w w w .j a v a 2s . co m * * @param endpoint * The Redshit Endpoint to convert to connection String * @param databaseName * The database name for the Redshift cluster * @return The JDBC connection String associated with the Endpoint and database name */ private static String toJDBC(Endpoint endpoint, String databaseName) { StringBuilder jdbc = new StringBuilder(); jdbc.append("jdbc:postgresql://"); jdbc.append(endpoint.getAddress()); jdbc.append(":" + endpoint.getPort()); jdbc.append("/" + databaseName); return jdbc.toString(); }