Snowflake Jdbc rs.beforeFirst() method error

155 Views Asked by At

I am trying to get test by using snowflake jdbc .I connected . but when I try to get some data from snowflake I got this error.net.snowflake.client.jdbc.SnowflakeLoggedFeatureNotSupportedException. I asked the snowflake support they said you are using rs.beforeFirst() method .snowflake driver doesn't support that. Anyone Know how to fix that [enter image description here](https://i.stack.imgur.com/DuNQi.png)

I expected like get column get some data .I think I should try without rs.beforeFirst() method to create db_util class please if anyone know .help me

1

There are 1 best solutions below

0
Stephen C On

According to the javadocs for ResultSet::beforeFirst():

"Throws: SQLFeatureNotSupportedException - if the JDBC driver does not support this method."

It appears that the Snowflake JDBC driver doesn't support the method. And their support have confirmed that.

You asked:

Anyone know how to fix that?

You cannot fix it.

Apparently, it is not possible to reset a Snowflake cursor.

I guess you could close the ResultSet and repeat the query. It is inelegant, and potentially inefficient, but if you need to do it ...

If that approach won't work for you, you will need to find and use a different database product whose JDBC driver does provide a way to reset its cursors.