0

Is there a way to query a netezza database without explicitly installing its driver? I am using ubuntu 64 bit OS, our IT support says the driver they have only works on red hat systems.

2 Answers 2

1

If you can get your hands on the JDBC driver, you could use the Python, jaydebeapi module, with the driver to connect to the server. Note that there are a couple quirks involved. Namely things like boolean datatypes.

Sign up to request clarification or add additional context in comments.

6 Comments

Thanks. I got an error: jpype._jexception.NzSQLExceptionPyRaisable: org.netezza.error.NzSQLException: Connection refused. Check that the host name and port are cor rect and that the postmaster is accepting TCP/IP connections.
conn = jaydebeapi.connect("org.netezza.Driver", "jdbc:netezza://db_url:5480/db", ["usr","pass"], "./nzjdbc3.jar",)
@BoQiang -- Either you have the wrong host/port or there is not connectivity from your computer to the host/port. Resolve that issue and try again.
I get TypeError: Class org.netezza.Driver is not found
@diman82 please open an issue and provide the code you've used and the error you're encountering. Feel free to comment and I'll check it out.
|
0

You can use pyodbc.

pyodbc is an open source Python module that makes accessing ODBC databases simple. It implements the DB API 2.0 specification but is packed with even more Pythonic convenience.

On Ubuntu systems, all you need to do is run

sudo apt install unixodbc-dev

before attempting

pip install pyodbc

See more details from Installing pyodbc.

2 Comments

Thanks. In unixodbc.org, I did not find it contains a driver for Netezza. Do you have any examples for how to set it up? Thanks again.
@BoQiang Have a look at the pyodbc doc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.