Accessing Postgresql server given link - postgresql

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:".

Related

Connection String and Connecting to SQL DB

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

Can't make PostgreSQl instance

i am user postgresql 9.1
When i type the fallowing :
<?php
new PostgreSQL ('localhost','5432','postgres','postgres','12345'); i get the error
?>
Fatal error: Class 'PostgreSQL' not found in /var/www/vhosts/task/db_actions.php on line 11
I tried with new Postgresql or new Pg_SQL but same thing. I am using Ubuntu, can anybody help
Well, even if you had a PHP class called "PostgreSQL" (you don't - that's what the error is saying) you're just connecting then throwing the object away.
Perhaps take some time to read the PHP manuals, maybe search the internet and find a beginners guide or turorial you find helpful.
A description of the simple database access functions are here and a popular cross-database wrapper is known as PDO. Good Luck!
Edited in response to comment:
If you know the correct driver class to use, and how to use it then why have you given a deliberately incorrect example of your code? If you know what the error means then you no longer have a question. You don't know what the error means because you asked. There is no (standard) class "PostgreSQL" that acts as a database driver that I know of. Nor are there "ASDFASDF" or "QWERTYUIOP" classes that will talk to a PostgreSQL database.
You're not using either of the two standard driver classes that I linked to. So, either you're advanced enough to have rejected those and written your own driver or you don't know what you're doing. If you've not found the standard drivers in the PHP manuals and/or don't know how to install them then you need to take the time to find a tutorial - you don't have one question, you've got dozens but can't see them yet because you're stuck behind this one.
Clearer now?

iOS webservice xml help

i am trying to create an app that connects to a mysql database, downloads the records in the table for the user then displays them in a UITableview which can be drilled down with the data that as downloaded from the mysql database. I would also like the data to be stored locally in something like sqlite. The data would then be modified then uploaded back to the mysql database.
My questions is where do i start? I have read alot of posts on google and they say that its best to connect to a xml which acts as a middle man between the database and the app. How can i create this xml file? is it something that is generated every time the app is launched or something done daily on the server?
If anyone can help me out. i know its a very broad question so if someone can point me in the right direction im not asking someone to right this app just a hand as im lost.
Thanks,
Aaron
I know others have mentioned links to libraries that let you connect to MySQL from iOS. I've not tried them myself but don't rule that out.
To answer your quest, you do not "create" the XML files. Web services are developed in a language, and written as applications. You would in essence need to write another application that runs on a server. That application would connect to your MySQL database. That application would also publish methods for getting at, and updating, data. By virtue of making your server a SOAP web service (in whatever platform), the data will be sent over the wire as XML.
If I have understood you want a kind of ORM?
If so you can check for Restkit and more specifically on the side of the object mapping system. It allows us to synchronize remote object/data locally with the coredata.
I have never used it, but I have seen a great tuto which talking about that here: Advanced RestKit Development (However I think it works only with json messages).
I hope it'll help you in your reflection.
I would recommend looking at XML Parser, Webservice, and Core Data tutorials.
SOAP and XML Response Parsing Samples for iPhone/iPad?
http://www.techotopia.com/index.php/An_iOS_4_iPhone_Core_Data_Tutorial_%28Xcode_4%29
That would be a good start, and I could give you some more material if you would like. As far as setting up your actual web service, I've never done that so I couldn't help you there.

Is it possible to have a free web-service that would check a page and email its HTML code to me?

I just asked a question about whether it was possible to write a web-page-checking code and run it from free web server, and one supporter answered and said that it was possible and suggested that I used Google App Engine service.
But he also said that there are no files there, so I would have to work with their database.
I wonder, if there is no such feature as creating files on that free web server, then is it possible to run from that free web server a code that would check a web-page every once in a while, record its HTML code, and mail it to my mail box?
It is totally possible on Google AppEngine.
I am not sure by you mean "no files" on GAE: there is definitely access to files but in "READ ONLY" mode.
What you have to do is fetch the remote WEB page (through urlfetch API) and use the email API to send it.

what language combination should I use to permanently modify a webpage?

I'm trying to make a page with 2 fields (email and feedback) and 1 button. When the user clicks on the button, a table on a page else where is filled in with the data, permanently.
Does anyone have recommendations of how I should do this? I'd like to avoid having a script send me an email, or writing to a database. But if I have to, which ever is easier to configure would be prefered.
Thanks,
Matt
So you want a comments system like you find on most blogs? You'll need to store those comments somewhere, probably in a database. As for how to do it, that would depend entirely on what you already know and what the site is currently written in. You could use PHP and MySql if you already have those skills, or ASP.Net/SQL Server, or if you want to be down with the cool kids you can use Ruby on Rails or Python/Django.
If you post what languages you already have experience in, and/or what the site is written in you might get a more specific answer :-)
There're 2 types of scripts: server side and client side. The client side script (JavaScript) stores info only for particular visitor on his computer and this can't be seen by anybody else.
You need a server side script to save feedback on the server. The language or technology depends on the hosting server you use. Not all hosting services allows server side scripts. You need first to find out what scripting languages and technologies are supported by your hosting provider. Then we can help you more.
ADD:
For an unexperienced persons I recommend to search for hosting services which has most needed functionality. Something like blogs, etc. On such services you could create pages that will have comments and feedback and many more.
While it may seem outdated it's not necessarily a bad design. You can use PHP or Perl (due to it's string parsing capabilities) and simply store the main page on the disk.
Here's your sudo code/design...
You'll need need an html page that looks as follows
<tr><td>email</td><td>comment 1</td></tr>
<tr><td>email 2</td><td>comment 2</td></tr>
<tr><td>email 3</td><td>comment 3</td></tr>
Then you'll need a php script page that will read this html file in and display it.
The php page will also contain code for dealing with a user submitted comment. When a user posts a comment you need to open the html page with the rows in it and append to that file.
You need to be careful with this design however because you may run into write concurrency issues if two people attempt to read the file at the same time. Add code to handle this gracefully accordingly.