0

I can't get a clear picture on the db connection.

We have a server in Linux. It has a DerbyDB too. I can have a db in it.
I have to create a program that runs on more than one client computers (windows).

The client programs will perform add-delete-update operations on records in remote db over LAN.

How can I connect to remote db? (they would not allow any server side program so sockets may not work out here).

I have to give Server IP manually before login(if the server IP change) The Login to log-out should have a db connection.

I am using Java Swing (NetBeans)

I want to test the connection is by giving the IP, and run a simple SELECT on db.

I am afraid about the IP, Port issues. I just need to communicate to db other than manual IP assign in code.

Can anyone help?

Aman Alam
  • 11,231
  • 7
  • 46
  • 81
Abel Jojo
  • 758
  • 3
  • 14
  • 30
  • I am quite rusty in my Java Swing skills now, but I feel you can get this done by using normal JDBC connection methods. And if your server is in a good condition, the IPs won't change that frequently – Aman Alam Jul 08 '12 at 08:39
  • @SheikhAman i prefer a conf/txt file where the host,username,password is editable. And the program always read from it. It makes the program distributable. – Abel Jojo Jul 08 '12 at 11:37

1 Answers1

1

You can do it using JDBC.

You need to provide the host,port,username,password and it should work.

The steps you need to do are:

  1. Download the derby JDBC driver
  2. Add it to your class path
  3. Use the correct url to connect
Tomer
  • 17,787
  • 15
  • 78
  • 137