You know how you connect to a server?

--- Update ---

And who database you will used?

--- Update ---

I think when you see this code you have a ide how you can do the :-)