![]() createStatement () // Specify the number of statements (3) that we expect to execute. String command_string = "create table test(n int) " + "insert into test values (1), (2) " + "select * from test order by n" Statement stmt = connection. Create a string that contains multiple SQL statements. The example below sets the MULTI_STATEMENT_COUNT parameter, executes 3 statements, and retrieves update counts This method returns true when the next result is a result set, and false when the next result is an update count (or there are no more results). To access the results of the statements that follow, use the getMoreResults() method. When multiple statements are executed in a single execute() call, the result of the first statement isĪvailable through the standard getResultSet() and getUpdateCount() methods. This parameterĪffects more than one Snowflake driver/connector. The MULTI_STATEMENT_COUNT parameter is not part of the JDBC standard it is a Snowflake extension. To execute multiple statements without specifying the exact number, pass a value of 0. ![]() The default number of statements is 1 in other words, multi-statement mode is off. setParameter ( "MULTI_STATEMENT_COUNT", 3 ) Specify the number of statements that we expect to execute. RUNNING while ( queryStatus = QueryStatus. executeAsyncQuery ( sql_command ) // Assume that the query isn't done yet. println ( "Simple SELECT query: " + sql_command ) resultSet = statement. createStatement () sql_command = "SELECT PI()" System. println ( "Create JDBC statement." ) Statement statement = connection. String sql_command = "" ResultSet resultSet System. SnowflakeStatement interface, and then call one of those methods, in this case setParameter: The following code shows how to unwrap a JDBC Statement object to expose the methods of the You can then call the additional methods. To access these Snowflake methods, you “unwrap” an object (such as a Statement object) to expose the Snowflake Snowflake-specific objects that implement not only the methods of the JDBC standard, but also the additional methods create a JDBC Statement object byĬalling a Connection object’s createStatement() method), the Snowflake JDBC driver actually creates When the Snowflake JDBC driver is asked to create a JDBC object (e.g. The SnowflakeStatement interface contains a getQueryID() method that is not in the JDBC Statement interface. Java-language interfaces, such as SnowflakeConnection, SnowflakeStatement, and SnowflakeResultSet. These methods are defined in Snowflake-specific The Snowflake JDBC driver supports Snowflake-specific methods.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |