Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redshift-jdbc42 dont return tablename from ResultSetMetaData #2

Open
eskuai opened this issue Jul 16, 2018 · 0 comments
Open

redshift-jdbc42 dont return tablename from ResultSetMetaData #2

eskuai opened this issue Jul 16, 2018 · 0 comments

Comments

@eskuai
Copy link

eskuai commented Jul 16, 2018

Hello

I got a null from ResultSetMetaData getTableName using Redshift.

Anyway, a minor fix will be check tablename, schame are availables and not null ...

I am using

com.amazon.redshift
redshift-jdbc42
1.2.8.1005

I finally remove info from schema and table:

private static Pair<String, Integer>[] getColumns(ResultSetMetaData rs) {
int columnCount = 0;
try {
columnCount = rs.getColumnCount();
Pair<String, Integer>[] columns = new Pair[columnCount];
for (int i = 0; i < columnCount; i++) {
StringBuilder builder = new StringBuilder();
builder.append(rs.getColumnName(i + 1));
Integer type = rs.getColumnType(i + 1);
columns[i] = cons(builder.toString(), type);

		}
		return columns;
	} catch (SQLException e) {
		throw new DataAccessException(e);
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant