Page 1 of 1

connecting databases

PostPosted: Sun Apr 13, 2014 10:27 am
by mikemiller
Can somebody help please
When I create new postgresql database I cannot find it anywhere on computer.
It gives URL as JDBC:postgresql://localhost:5432:[new data base name]
I need to know where to find it
I am new to Java . I have spent many years just developing in foxpro for own company.
What does" "localhost" refer to
Michael

Re: connecting databases

PostPosted: Mon Apr 14, 2014 6:50 am
by sovanm
Hi Micheal,

Welcome to the servoy community.. :)

PostgreSQL come in bundled with servoy. When you installed servoy you must have got an option to installed bundled PostgreSQL or want to connect to some other database.
If you have selected to install PostgreSQL, you can find the PostgreSQL folder here
/path/to/application_server/postgres_db


If you want to administrate PostgreSQL externally, you can use PGAdmin.

For your second portion, "localhost" refers to the PostgreSQL's instance that is running on your own machine. When you start the servoy developer, you are also starting the PostgreSQL instance which can be reached with that URL.

Thanks

Re: connecting databases

PostPosted: Mon Apr 14, 2014 9:15 am
by ROCLASI
Hi Michael,

Welcome to the forum :)

mikemiller wrote:What does" "localhost" refer to


Certain JDBC drivers connect to file-based databases like SQLite, VFP and even CSV files so you would see the file path in the connection string. With PostgreSQL however you need to connect to the (PostgreSQL) server to access the database, just like you would with MSSQL Server (and others). So then the connection string will require an network address. In your case localhost is a standard hostname for the local machine which translates to the IP address 127.0.0.1.
And in the connection string you see that behind the colon you find the port number PostgreSQL is listening on (5432).
So the syntax is: JDBC:postgresql://<address>:<port>:<databasename>

There is a wikipedia page explains localhost in more detail.

Hope this clears things up for you.