LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-07-2009, 01:02 PM   #1
nbcohen
Member
 
Registered: Mar 2003
Location: Northern Virginia
Distribution: RH Enterprise, Fedora
Posts: 96

Rep: Reputation: 17
Web app - multiple database connections


I have been building some web applications (using Netbeans) that access a MySQL database using Hibernate on the server. Works fine. But I have a new application that has a local database and one of the tables contains a list of remote databases that I need to access. I'm not sure of the correct way to connect to and manipulate those remote databases. The remote systems are also mysql databases, and I just need to add/update/delete information from them. Don't need to do anything complicated like joins or searches - at least not at the moment.

Can someone point me at either some sample code or a tutorial that would get me started? Do I want to try to use Hibernate for the remote access or just open a jdbc connection and use sql statements across the net?

Thanks in advance,

nbc
 
Old 07-07-2009, 04:44 PM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
MySQL supports connections from other hosts. For most languages a MySQL connector exists where you can specify both the host and database on the host. When you have made a connection, the connector function usually returns a handle which can be used for further references to that connection.

It seems to me that Hibernate is no different as you have to specify the host when making a connection, but the Hibernate documentation should make that clear.

If you access the remote databases make sure the access rights in those databases are set correct for remote access. This is not normally so by default, each [range of] host[s] must be allowed explicit access in the database.

jlinkels
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
using TCP to do ssh connections within an app nano2 Linux - Software 6 09-19-2008 05:20 AM
LXer: Java, Web Service, and database apps with Rational App. Developer v7 LXer Syndicated Linux News 0 03-10-2008 12:00 PM
Fastest, easiest, way to creat a web database app? walterbyrd Linux - Software 3 04-15-2006 02:46 PM
One Web Server on Multiple Internet Connections familyman Linux - Networking 5 09-18-2004 06:38 PM
gui database app macewan Linux - Software 13 02-24-2003 03:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration