I am new to Python. Can someone tell me what software should I install (Pycharm??) so that I can write program to connect to Teradata. Any sample code in python to get a specific table extraction will be useful too for me.
Related
I'm trying to connect to an oracle database via the cx_Oracle python library but am getting the error message "ORA-12571: TNS:packet writer failure".
My connection logic currently looks like this:
import cx_Oracle as cOr
cOr.connect("USER_NAME/USER_PASSWORD#HOST_NAME:PORT/SERVICE_NAME")
My program is running on the WSL2 environment on a windows10 machine, so somehow I think this is where the trouble originates from. The python version I'm using is 3.6.9, cx-Oracle is 8.2.1 and this instant client necessary for the cx-Oracle is in version 21_1.
I found for example this article here https://support.microfocus.com/kb/doc.php?id=7018259 on this topic. Yet all the checks they mention there succeed for me, so it shouldn't be, that the target is simply not reachable from my system.
Also just using the Oracle SQL developer from the Windows part of the machine with the same data is working just fine.
I'm a bit out of ideas of what to do on this topic and hope for somebody to maybe give me a good hint. If there is any additional information you need from me I'll gladly provide it.
just a general question.
I have written some Python codes in Spider. In my code, I use sql command to pull data from ssms then use Python to manipulate them. Now I want to implement my codes on a webpage or other online sources so other can run them. How would be possible? Any thought would be appreciate :) Thanks!
P.S I'm a PC user not MAC
Here's a link to a list of Python-based web frameworks:
https://wiki.python.org/moin/WebFrameworks
I know people who like Flask (http://flask.pocoo.org/), and it has some thoughtful-looking Windows installation instructions here: http://flask.pocoo.org/docs/0.12/installation/#installation.
Also, you might also look at the Python library pyodbc to directly make your queries if I understand you right that you're using sqlcmd.
After several weeks looking for some information here and google, I've decided to post it here to see if anyone with the same problem can raise me a hand.
I have a java application developed in Eclipse Ganymede using tomcat to connect with my local database. The problem is that I want to send a simple message ("Hello World") to a Kafka Topic published on a public server. I've imported the libraries and developed the Kafka function but something happens when I run in debug mode. I have no issues or visible errors when compiling, but when I run the application and push the button to raise this function it stops in KafkaProducer function because there is NoClassDefFoundError kafka.producer..... It seems like it is not finding the library properly, but I have seen that it is in the build path properly imported.
I am not sure if the problem is with Kafka and the compatibility with Eclipse or Java SDK (3.6), it could be?. Anyone knows the minimum required version of Java for Kafka?
Also, I have found that with Kafka is really used Scala but I want to know if I can use this Eclipse IDE version for not change this.
Another solution that I found is to use a Python script called from the Java application, but I have no way to call it from there since I follow several tutorials but then nothing works, but I have to continue on this because it seems an easier option. I have developed the .py script and works with the Kafka server, now I have to found the solution to exchange variables from Java and Python. If anyone knows any good tutorial for this, please, let me know.
After this resume of my days and after hitting my head with the walls, maybe someone has found this error previously and can help me to find the solution, I really appreciate it and sorry for the long history.
Please include the Kafka client library within the WAR file of the Java application which you are deploying to Tomcat
Please use org.apache.kafka.clients.producer.KafkaProducer rather than kafka.producer.Producer (which is the old client API) and make sure you have the Kafka client library on the classpath. The client library is entirely in Java. It's the old API that's written in scala, as is the server-side code. You don't need to import the server library in your code or add it to the classpath if you use the new client API.
At the end the problem was related with the library that was not well added. I had to add it in the build.xml file, importing here the library. Maybe this is useful for the people who use an old Eclipse version.
So now it finds the library but I have to update Java version, other matter. So it is solved
I use SQLite3 in python because my school computers don't allow us to install anything to python so I used the pre installed SQLite3 module.
I'm working on a program whose back end relies on an SQLite3 database, however the databases are created and stored on their computer.
Is it possible for me to "Host" an SQLite3 database on let's say a server and allow my script to access them remotely (my script could edit the database from my school computer)?
By the way, I'm using python 3.X
EDIT
i made a database api that runs in python 3, its called TaliffDb
to install type pip3 install TaliffDB in your terminal. im working on a documentation, but please do comment if you have any questions
Write an API on the remote server, yes. This could be hosted by a web framework of your choice.
You won't get a direct network connection to a file
First of all, I need to say that I am a girl who knows very little about remote server. A lot of similar questions asked here is very difficult for me to understand. So I come to ask.
My task is to generate a script which helps me fetch some data from a server.
The data is stored in Hadoop. Usually I log in the server with a user name and a temporary password. I run 'hive' clauses on the server. After I get all the data on the server, I download it. Then on my computer, I manipulate the data on my own computer with Python.
Now I hope to do this with one Python script.
I find thrift package, but don't know how to begin to understand.
I wonder should I install hive on my computer, then use sys to run hive. Or should I log in the server and run hive on the server in my script?
In any case, can thrift help me log in the server?
Thanks very much!
Although Thrift can surely help you, it is recommended to use a more higher-level client. They are usually well-tested and will keep all (or most of) the low level stuff away from you. In particular, HBase looks promising in your case. I'd recommend to have a look at that one, and to compare it with the Hadoop Python Thrift Client described in this tutorial.