Installing Snowflake JDBC driver

妖精的绣舞 提交于 2019-12-11 00:55:14

问题


I am trying to install Snowflake JDBC driver according to instructions.
I have downloaded and installed Java from here, then downloaded snowflake-jdbc-3.6.9.jar file from here. When I double-click the file, nothing happens. So I opened CMD and tried this:

java -jar snowflake-jdbc-3.6.9.jar

I received *no main manifest attribute, in snowflake-jdbc-3.6.9.jar*.
When I open META-INF\MANIFEST.MF file, I do see:

*Manifest-Version: 1.0*

*Main-Class: net.snowflake.client.jdbc.SnowflakeDriver*

I have gotten this far using suggestions from other StackOverflow topics, and don't know what else to try. I don't know much about Java, I just need to install this driver, so I could connect to Snowflake from a BI tool. I would really appreciate your help.


回答1:


Have you tried adding the jar to classpath and then running the following command, Class.forName("provided driver name") in the calling class? Doing this with an IDE like Eclipse or Netbeans should make this process much simpler (particularly adding the jar to your project classpath)




回答2:


Those clients are great, others that you might find these guides useful from the Snowflake blogs include:

  1. MySQL Workbench https://community.snowflake.com/s/article/configuring-sql-workbenchj-to-use-snowflake
  2. Using R https://community.snowflake.com/s/article/connecting-r-to-snowflake-using-the-jdbc-driver-mac-os-x
  3. Pentacho https://community.snowflake.com/s/article/configuring-a-jdbc-connection-to-snowflake-using-
  4. Jupyter Notebooks https://community.snowflake.com/s/article/Connecting-a-Jupyter-Notebook-Part-4

Hope that helps!




回答3:


Couple of solutions to the above:

1) Using CLASSPATH:

  • MacOS/Linux: EXPORT CLASSPATH="Path/to/JDBCjarfile:$CLASSPATH"

  • Windows: There are a couple of way of setting the CLASSPATH

a) Run the following in CMD:

 set CLASSPATH=path1;path2

b) In Search, search for and then select: System (Control Panel)

Click the Advanced system settings link.

Click Environment Variables. In the section System Variables, find the CLASSPATH environment variable and select it. Click Edit. If the CLASSPATH environment variable does not exist, click New.

In the Edit System Variable (or New System Variable) window, specify the value of the CLASSPATH environment variable. Click OK. Close all remaining windows by clicking OK.

Reopen Command prompt window, and run your java code.

Document reference: https://www.java.com/en/download/help/path.xml


To confirm if the CLASSPATH variable is EXPORTED or SET:

1) MacOS/Linux:

$ echo $CLASSPATH

2) Windows:

$ echo %CLASSPATH%


来源:https://stackoverflow.com/questions/54504404/installing-snowflake-jdbc-driver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!