# Problem Connecting to H2 Datasource

**URL:** <https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594>\
**Category:** Support\
**Created:** [September 11, 2023, 7:40am UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594 "2023-09-11T07:40:08Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Badal\_Kumar\_Panda](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/badal_kumar_panda/32/1926_2.png) [@Badal\_Kumar\_Panda](https://community.stardog.com/u/Badal_Kumar_Panda)\
**Post date:** [September 11, 2023, 7:40am UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/1 "2023-09-11T07:40:08Z")

</div>

Hi,

I am trying to create a Datasource from my Stardog Studio (Stardog Free Cloud) instance to a dataset present in my Local H2 database using JDBC. But I get Error. Below are the configuration setting and error message I get. Can anyone help how to establish a connection successfully ?

H2 Query Page :

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/e36594dd835e69015a653d6794420f2b2dec9508.png)

Stardog Studio Config:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/a/a60658e161f764b0dd95720f4e920291888a857f.png)

The JDBC Driver is present in the bin directory of the installed folder in local machine.

The error that I get after clicking Add button is:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/f/fe2cd2b9cc66a081eb2a1ffc4224ecefa525f3a1.png)

It seems there is some problem with the org.h2.Driver class. But what step should I take to fix the issue I am not able to figure out. Can anyone please help ?

Regards,  
Badal

---

<div class="post-metadata">

**Author:** ![PaulJackson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pauljackson/32/243_2.png) [@PaulJackson](https://community.stardog.com/u/PaulJackson)\
**Post date:** [September 11, 2023, 2:43pm UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/2 "2023-09-11T14:43:20Z")

</div>

Hi Badal,

You want to place the JDBC driver in your own folder and set the STARDOG\_EXT environment variable to point to that folder. See [Using Virtual Graphs | Stardog Documentation Latest](https://docs.stardog.com/tutorials/using-virtual-graphs#jdbc-setup)

-Paul

---

<div class="post-metadata">

**Author:** ![Badal\_Kumar\_Panda](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/badal_kumar_panda/32/1926_2.png) [@Badal\_Kumar\_Panda](https://community.stardog.com/u/Badal_Kumar_Panda)\
**Post date:** [September 11, 2023, 2:49pm UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/3 "2023-09-11T14:49:08Z")

</div>

Hi Paul,  
I am using the StarDog Cloud Free instance. In which folder exactly I have to place the JDBC driver ? And where can I find the STARDOG\_EXT env variable ? Can you provide details with screens shots please ? I have this Jar placed in the BIN directory of H2 DB set up.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/b/b189dd4d7fa34d7fc3c04ce626d7a787ea6ae1bc.png)

---

<div class="post-metadata">

**Author:** ![PaulJackson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pauljackson/32/243_2.png) [@PaulJackson](https://community.stardog.com/u/PaulJackson)\
**Post date:** [September 11, 2023, 3:07pm UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/4 "2023-09-11T15:07:39Z")

</div>

My apologies. You mentioned that. We only support these drivers in our cloud offering. [Supported Data Sources | Stardog Documentation Latest](https://docs.stardog.com/stardog-cloud/supported-data-sources)

-Paul

---

<div class="post-metadata">

**Author:** ![Badal\_Kumar\_Panda](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/badal_kumar_panda/32/1926_2.png) [@Badal\_Kumar\_Panda](https://community.stardog.com/u/Badal_Kumar_Panda)\
**Post date:** [September 11, 2023, 3:19pm UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/5 "2023-09-11T15:19:43Z")

</div>

No Problem Paul. Good to know that. However , I do have a postgres set up and I can create few tables over there. Would you be able to share the details how can I create data source from postgres in stardog and where should I place the jar file in Postgres set up in my local system ?

The usecase I am trying to do is - I want to create a virtual Graph in Stardog Cloud instance without copying the data to Stardog. I need to map the physical data from postgres to a business mapping to create the virtual graph.

The problem I am facing is - I am not able to create a data source in Stardog Cloud with an external data store. So far I have tried below and unsuccessful

1. Oracle Server in Virtualbox
2. Databricks Community Edition
3. H2

I want to give it a try for Postgres next. So please share some screenshots on how to configure it in Stardog

---

<div class="post-metadata">

**Author:** ![PaulJackson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pauljackson/32/243_2.png) [@PaulJackson](https://community.stardog.com/u/PaulJackson)\
**Post date:** [September 11, 2023, 4:00pm UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/6 "2023-09-11T16:00:40Z")

</div>

You won't need to install the drivers as they're already installed on Stardog's hosted servers. The only constraint that I'm aware of for PostgreSQL that you need to be mindful of is the Postgres server must be accessible from the internet, so you won't be able to run the server on your workstation and use `localhost` in the JDBC connection string. The connection string needs to be one that is accessible from the Stardog server, which is a cloud-hosted server. You could use Amazon's RDS, for example.

-Paul

---

<div class="post-metadata">

**Author:** ![Badal\_Kumar\_Panda](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/badal_kumar_panda/32/1926_2.png) [@Badal\_Kumar\_Panda](https://community.stardog.com/u/Badal_Kumar_Panda)\
**Post date:** [September 12, 2023, 2:15am UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/7 "2023-09-12T02:15:42Z")

</div>

I have tried even with one RDS MySQL instance. I ran into error. The challenge is mainly is in the config section in Stardog Designer. Driver details, Class Details etc. There are not enough documentation on how one can set up a cloud stardog instance with a online data source successfully. At least, one example with config details, screenshots etc should be provided for beginners of stardog in the tutorials or how-to section. That would make the tool more user friendly and would encourage users to achieve something with the cloud trial version.

Regards,  
Badal

---

<div class="post-metadata">

**Author:** ![PaulJackson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pauljackson/32/243_2.png) [@PaulJackson](https://community.stardog.com/u/PaulJackson)\
**Post date:** [September 12, 2023, 2:43pm UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/8 "2023-09-12T14:43:17Z")

</div>

Hi Badal,

You can find a decent Designer tutorial [here](https://www.stardog.com/trainings/designer/#lesson-1-stardog-designer-introduction). For simplicity, it uses csv files. To use MySQL, follow the same steps but click database instead of file when setting up the data source. Then select MySQL and MariaDB. Finally, give the data source a name, and supply your JDBC connection string, username, and password.

An example connection string for Amazon RDS is: `jdbc:mysql://myrdshost.myaccountcode.us-east-1.rds.amazonaws.com:3306/mydatabase?useSSL=false`

More details on the JDBC connection string can be found [here](https://dev.mysql.com/doc/connector-j/8.1/en/connector-j-reference-jdbc-url-format.html).

Regards,  
-Paul

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [October 25, 2023, 6:18pm UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/9 "2023-10-25T18:18:21Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [December 12, 2023, 7:42pm UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/10 "2023-12-12T19:42:00Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [February 3, 2024, 11:20pm UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/11 "2024-02-03T23:20:02Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [April 1, 2024, 3:53am UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/12 "2024-04-01T03:53:32Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [July 1, 2024, 11:01am UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/13 "2024-07-01T11:01:47Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [January 4, 2025, 8:40am UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/14 "2025-01-04T08:40:55Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [August 10, 2025, 11:44am UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/15 "2025-08-10T11:44:06Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [April 3, 2026, 3:16pm UTC](https://community.stardog.com/t/problem-connecting-to-h2-datasource/4594/16 "2026-04-03T15:16:17Z")

</div>


