20

http://www.h2database.com/html/download.html I don't see it on this website. Is there anything I missed?

emeraldhieu
  • 757
  • 4
  • 14
  • 23

5 Answers5

27

Dump this in your classpath: http://www.h2database.com/automated/h2-latest.jar

And then call

Class.forName("org.h2.Driver");

That should do it.

Vito Gentile
  • 725
  • 1
  • 5
  • 14
slotishtype
  • 3,025
  • 1
  • 18
  • 19
8

Go to the downloads page of the H2 website as you did. Download the INSTALLATION file for H2 and install it. Then, go to the folder where you installed it. The path to that folder (on a windows pc) should be C:\Program Files (x86)\H2\bin There will be a jar file there which looks like h2-some version number.jar. That is your driver. Bin means binary and that is usually the place where i look for any jar file.

sky scraper
  • 181
  • 1
  • 3
  • The questioner said he couldn't find the driver on the downloads page. – Flup Mar 20 '13 at 08:44
  • @Flup - You may have overlooked the fact that my answer guides the OP to the downloads page and then gets him the jar also. If you do what my answer says, then you will get the latest version of the file that slotishtype gave in his link. I actually checked the two files. – sky scraper Mar 20 '13 at 08:51
  • @Flup - Please up vote my answer. Looks like my score of 1 point affected your judgement. We all begin at 1 don't we ? – sky scraper Mar 20 '13 at 08:52
  • You've edited your post since I downvoted it which has made it much more helpful, so I'll remove my downvote -- thanks :) – Flup Mar 20 '13 at 08:58
  • @Flup - The content of my post is essentially the same. Only a word or two were changed. – sky scraper Mar 20 '13 at 08:59
8

Any downloaded .jar file in the Jar File section on Downloads page is the JDBC driver itself, e.g.: h2-1.4.188.jar

Thach Van
  • 181
  • 1
  • 1
  • 1
    This is a great answer. None of the other answers actually mention the "Jar File" section of the downloads page, nor do they explain that the files in that section are in fact the drivers the OP is looking for. – industry7 Jan 11 '17 at 14:41
1

I'm saddened that people still recommended (even 6 years ago) direct jar usage, instead of promoting maven/gradle/whatever build automation tool. From the downloads page maven section you can get maven URL for direct download, and translate it to your build tool's format. Below is its maven interpretation:

    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>1.4.200</version>
    </dependency>
Dragas
  • 133
  • 1
  • 7
0

As @ThachVan explained, the H2 jar file is the JDBC driver itself. Get it from https://mvnrepository.com/artifact/com.h2database/h2

  • Instead of copying another answer, upvote it. – Toto Dec 02 '21 at 13:34
  • @Toto Of course I upvoted that. The link to the file may be useful, however. That includes both the option to get the jar file as well as getting the Maven/Gradle/... coordinates – Markus Pscheidt Dec 02 '21 at 13:58