Reputation: 31
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.
Upvotes: 3
Views: 8120
Reputation: 59
I presume you got it up and running by now.
But as mentioned by one of the other responders, by copying the .jar
file to your computer you have already more or less installed the driver.
Different from OBDC drivers
, there is no JDBC manager
, which expects that JDBC drivers
need always to be installed in a certain directory.
You have to point the used application to this driver to use this driver.
Let's take as an example dBeaver, a popular JDBC Query tool among Snowflaker
users. (And available for Windows
, Mac
and Linux
)
Before you can use this driver within dBeaver
, dBeaver
has to be made aware that this driver does exist and can be used.
So after starting up dBeaver
you first point dBeaver to the location where you have put the Snowflake
.jar file.
(Let's assume that you don't want to use the preconfigured Snowflake JDBC driver for the sake of usefulness of my answer)
So you select New and select 'create new driver'
Under the windows [Libraries] you can add a file or a folder. Select [Add File] and point at your JDBC .jar file.
As of then you can use the JDBC driver.
For completeness are here the other details to use a different Snowflake JDBC driver than the provided one in dBeaver:
[Driver Type:] Snowflake
[Class Name:] net.snowflake.client.jdbc.SnowflakeDriver
[URL Template:] this contains the default connectstring format to use this JDBC driver (So how a connectstring should look like to make a successful connection to Snowflake)
[Default Port:] 443 (should have been preset)
The rest should be self explanatory.
Upvotes: 2
Reputation: 1
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%
Upvotes: 0
Reputation: 425
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)
Upvotes: 0