Solved

H2 with python

Posted on 2016-07-15
6
380 Views
Last Modified: 2016-09-23
Hi,

I have a h2 database that i need to manipulate with python 2.7.

I saw in google that this is indirectly possible by setting up a postgre sql instance but i didn't understand what i should do after installing postgre server.

Any help?

Br.
0
Comment
Question by:jazzIIIlove
  • 4
6 Comments
 
LVL 26

Expert Comment

by:Zberteoc
ID: 41714536
Is it H2 or PostgresSQL you are trying to connect to?
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 41724989
It is h2
0
 
LVL 26

Assisted Solution

by:Zberteoc
Zberteoc earned 500 total points
ID: 41725001
Apparently Python doesn't have a H2 driver to be able to connect directly but there is a way to use Java ODBC driver from Python but you have to setup few things. Here is a module that will allow you to use a Java drive in order to connect to an H2 database. I have never used H@ but it is rare that Python doesn't have a module for a database product because if it did the way to work with it would be the same to any other db product.

https://pypi.python.org/pypi/JayDeBeApi/
0
 
LVL 26

Assisted Solution

by:Zberteoc
Zberteoc earned 500 total points
ID: 41725007
This might be useful if you choose Postgess:

https://statyili.wordpress.com/2010/02/27/in-memory-db-h2-and-python/
0
 
LVL 26

Accepted Solution

by:
Zberteoc earned 500 total points
ID: 41725010
I found a reference that say that the use the psycopg2 module in Python but then you have to setup the H2 to run in Psotgress mode:

https://pypi.python.org/pypi/psycopg2

You need to install that module in Python then setup H2 in postgress mode and then you should be able to connect to it.

http://queforum.com/postgresql/836561-postgresql-there-python-module-supports-h2-database-%5B-hold%5D.html
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Cassandra Select Query 1 87
SQL Server encoding for storing Indian languages 9 52
Sql Join Problem 2 53
Database ERD 4 32
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question