For further details on setting up SDDM to talk to Snowflake, see this detailed blog. For example, you can connect to Java based applications like Oracle SQL Developer Data Modeler (SDDM), which can be used to reverse engineer the design of whatever tables and views you have been granted access to in Snowflake. If, on the other hand, you have a packaged application to connect, you can do that just as easily. Return DriverManager.getConnection(connectStr, properties) use the default connection string if it is not set in environmentĬonnectStr = "jdbc:snowflake://" // replace accountName with your account name String connectStr = System.getenv("SF_JDBC_CONNECT_STRING") Properties.put("schema", "") // replace "" with target schema name Properties.put("db", "") // replace "" with target database name Properties.put("account", "") // replace "" with your account name
Properties.put("password", "") // replace "" with your password Properties.put("user", "") // replace "" with your username Properties properties = new Properties() Private static Connection getConnection()Ĭlass.forName(".SnowflakeDriver") ResultSetMetaData.getColumnTypeName(colIdx+1)) ("Number of columns=" +įor (int colIdx = 0 colIdx < resultSetMetaData.getColumnCount() ResultSetMetaData resultSetMetaData = resultSet.getMetaData() ResultSet resultSet = statement.executeQuery("SELECT * FROM demo") Statement.executeUpdate("insert into demo values ('hello world')") Statement.executeUpdate("create or replace table demo(C1 STRING)") Statement statement = connection.createStatement() Public static void main(String args) throws Exception * Copyright (c) 2012, 2013 Snowflake Computing Inc.
This example shows how simple it is to connect and query data in Snowflake with a Java program, using the JDBC driver for Snowflake. If you have, or are building, a custom Java application, you can connect that app directly to Snowflake quite easily. Once you have the driver installed, you have several ways you can take advantage of it.
Click on the link provided for details on setup and configuration. To do that, login to your Snowflake account, go to the online help and select the JDBC driver under the downloads menu.
You can download and install the the Snowflake JDBC driver through our user interface.
You can easily connect various ETL, BI and visualization tools to Snowflake using the JDBC driver, just like they connect with many legacy databases. So why is this cool? Because all of the modern applications written in Java can take advantage of our elastic cloud based data warehouse through a JDBC connection.Īnd we have plenty of customers doing that today with industry leading tools. JDBC technology lets you access information in SQL databases using standard SQL queries. If you’re interested in connecting any custom or packaged Java based applications to Snowflake, JDBC is what you need. This seems like a no brainer but is very important. Īs promised in my original post, here is a deeper dive into another one of the top 10 cool features from Snowflake: #9 Ability to connect with JDBC Thank you for reading our previous post #10 Query Result Sets available to users via history.