Connection String and Connecting to SQL DB - postgresql

Im hosting a local postgres db and am trying to find open-source programs that will be able to connect to said db so that I can generate reports based on the data.
While I know Jasper is a thing, Im trying to see if there are alternatives and I came across 2:
EasyReport
Seal Report
Both of these ask for Connection Strings that Im not really familiar with.
Came across a site explaining it, but Im still unsure of the format.
Provider=PostgreSQL OLE DB Provider;Data Source=myServerAddress;location=myDataBase;User ID=myUsername;password=myPassword;
Driver={PostgreSQL};Server=IP address;Port=5432;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Above are some of the examples the site provided with, but Im still confused. What is the Driver? What is the Provider? The site's examples werent cleared on what are these 2 are supposed to be.
I tried creating a Connection String based on the example:
Provider=PostgreSQLData;Data Source=jdbc:postgresql://localhost:5432/<myDBName>;location=<myDBName>;User ID=<myDBUsername>;password=<myDBPassword>;timeout=1000;
This fails. Something about Provider not found and Could not connect to database: Couldn't set provider

Related

How can other people/computers connect to my PostgreSQL database?

I am fairly new to setting up PostgreSQL and I am trying to figure out an issue. I am trying to set up a database in PostgreSQL that my colleague and I can both access and edit. I have pgAdmin set up on my computer and a DB with some info in it. We both need to be able to work on it and access it from different computers. I have been googling around but I can't really seem to get this right. There is no interface that needs to connect, right now we are both simply trying to connect and access the same database.
I feel like this is something that should be fairly simple to implement. Any help?

How to connect simple website to RDS PostgreSQL DB

This is possibly a broad question:
I've been teaching myself how to program for the last year. I've learned how to create simple websites using HTML, CSS, and JavaScript. I've also learned how to create simple databases using PostgreSQL. I need help figuring out how to connect (API) the front end and the back end.
A friend suggested I learn how to use AWS RDS so I've already created a PostgreSQL DB instance there (tutorial). I've also connected to my DB using pgAdmin 4 using this tutorial.
What I would like to do is have my front end take in a number as the user's input and "submit" (POST) that value in the DB. Every time the user submits a new value, the new value is saved in the DB and the cumulative values of everything POSTed is returned to the front end for the user to see.
I know this project is a bit asinine but its a start. I can't find any more links on the internet to teach myself how to do this. If you have tips or resources (web links) to help me accomplish this, I would be really grateful.
Side note - I've also been studying python for the last year if that helps.
First, connect to the database like so:
$c1 = new PDO('pgsql:host=THERDSURL;user=THEDBUSERNAME;dbname=THEDATABASENAME;password=THEPASSWORD;connect_timeout=500',null,null);
Then start a new query like so:
$statement=$c1->prepare("select * from mytable");
Then execute it:
$statement->execute();
then loop through the results like so:
while($row=$statement->fetch());
{
var_dump($row)
}
it will vary a little depending on whether you're getting data or inserting data, but begin by learning how to get (select) data. Create a table using a GUI of some kind and learn how to query it programatically.
NOTE: Most people use a library of some kind to make the querying both more powerful and less complicated.. This code is in PHP, but a very similar process is done in many languages.
Note2: do not try to do any of this in javascript that's embedded in html or that's running on a client machine. Connecting to postgres using embeded javascript is not the normal way to go about doing this. Usually people use a language like PHP, Python, Java, etc.. and that's usually running on the server-- and although you can use javascript that runs on the server, I wanted to warn you about this because newer developers might not realize that javascript running on the server vs the browser has completely different capabilities where this is concerned.

Connect SAS to mongodb without using ODBC

One of ours statistician is stuck trying to read data from mongoDB using SAS.
In my experience connecting mongo to other languages always require a native driver, but in this case I've found that is only possible using ODBC.
I've tried to find a better way to connect this two software but the only idea that came to my mind is to expose mongo via webservice.
Any of you have a better solution to connect SAS to mongodb?
After some tries we found that using webservice is the most convenient way to solve mongodb access in ours case.
Some statistician required to load data on laptop from outside the corporate network so we decided to extend our web service to expose some more informations and access it in SAS like this https://blogs.sas.com/content/sasdummy/2016/12/02/json-libname-engine-sas/
Thanks all for the clarification regarding ODBC, to me was a real surprise that is still the preferred way to load data in enterprise environments.

Load a PostgreSQL database using cloudconnect

On the side of my Gooddata project, I maintain a small PostgreSQL database that contains a few tables.
I would like to be able to integrate both my ETL processes using the same tool, and it seems to me cloudconnect would be the easiest way, since I already have my whole GoodData ETL in it.
Here are the ways I tried to do it without success:
I tried to have a look in the documentation, and it seems to me that all the functionalities of CloverETL that enabled this (DBOutput, PostGreSQLDataWriter) are not available in Cloudconnect.
I managed to connect to the Agile Datawarehouse Service (Database attached to GoodData), but it seems that only the ADS database is able to understand the request:
COPY MyDataBaseTable (field1,field2) FROM LOCAL '${DATA_TMP_DIR}/CIforADS.csv'
even when I adapt the syntax to PostgreSQL because the dynamic addressing I use here does not seem to work.
Is there any way to proceed that I'm missing? Can anyone think of a workaround?
In general this could be achieved by using of "DBExecute" component, but
I'm not sure if I understand it well - do you want to load data into your own Postgres instance using CloudConnect?

Accessing Postgresql server given link

I have a back end development task where I am required to access a postgresql server and retrieve some reports. In the specification this is how it's stated
" You have two abstract reports made available to you on a PostgreSQL server located at:
postgres://aaaaaaaaaa.bbbbb.org/ccccc "
(I have censored the link because it contains the company name)
Basically I have no idea what to do with this link as I've never seen anything like it before. It doesn't work in a browser because it's not http. I have looked online and at other questions here on stackoverflow but I've seen nothing similar. Could it also be some form of typo?
You haven't looked very hard. Google "postgresql connection url".
http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING
or it could be part of a JDBC connection string
https://jdbc.postgresql.org/documentation/head/connect.html
I'm assuming you've made a mistake in your question and it's "postgresql:" not "postgres:".