Connecting to Snowflake with JDBC
The previous recipe talked about using SnowSQL to connect to Snowflake, which provides more control over how a user can interact with Snowflake. SnowSQL can be used with the Linux shell to automate code execution. But if applications have to be supported with Snowflake serving as a data tier, it will require more granular control over connecting and executing SQL. This recipe demonstrates how to install Snowflake's Java Database Connectivity (JDBC) driver and how to use that in a Java application to connect to a Snowflake instance. This functionality is captured in a Java app.
Getting ready
Ubuntu Linux 64-bit has been used for this recipe. The JDBC driver will be downloaded in the home directory of the sfuser
user on a 64-bit Linux host called sfchost
. These names have no significance and are abbreviations of the Snowflake user and Snowflake client host. Any Linux shell commands shown will be preceded by a sfcuser@sfchost:~$,
prompt, though...