Solved

H2 with python

Posted on 2016-07-15
6
286 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
oracle report printing 2 pages in one page 2 70
Download OAB 0x8004010f An object cannot be found 12 99
Exchange 2016 Databse move 5 56
Update from TABLE-A to TABLE-B 5 48
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Creating and Managing Databases with phpMyAdmin in cPanel.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

810 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