简体   繁体   中英

Server Derby db remote to client Java

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM