Quick Java Question

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2008
Posts: 5
Reputation: abelarion is an unknown quantity at this point 
Solved Threads: 0
abelarion abelarion is offline Offline
Newbie Poster

Quick Java Question

 
0
  #1
Dec 22nd, 2008
Hey,

I have a quick java question. I am building a Java application that uses an SQL database. I was wondering if it was possible to have this desktop application use the internet to connect to an SQL database setup on a remote server? This way the program data would be accessible by any computer with this application?

Thanks,
-Josh
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,515
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 523
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: Quick Java Question

 
0
  #2
Dec 22nd, 2008
Certainly. It's just a matter of using that url when you obtain the connection through DriverManager. There are examples of that with most JDBC drivers.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 5
Reputation: abelarion is an unknown quantity at this point 
Solved Threads: 0
abelarion abelarion is offline Offline
Newbie Poster

Re: Quick Java Question

 
0
  #3
Dec 22nd, 2008
Thanks for your response. I have another question or two. I apologize for these - I'm trying to piece things together (the textbook for school doesn't explain this very well).

My server is setup with MySQL. I located the JDBC driver: for MySQL. I've read through my textbooks and some docs that I found online, but my answer still is not clear. Do I need to install this JDBC on my server with the database or on my computer with the java application? I'm just a little confused about what needs to go where in order to make this work.

Thanks,
-Josh
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 1,175
Reputation: stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light 
Solved Threads: 125
Featured Poster
stephen84s's Avatar
stephen84s stephen84s is offline Offline
Veteran Poster

Re: Quick Java Question

 
0
  #4
Dec 23rd, 2008
The Type 4 JDBC Driver for the MySQL database which you are talking about needs to be on the client, where your java application is running.
Its exactly like using third party java libraries in your program. The "jar" file needs to be in your classpath while you are compiling and running your program.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."

"How to ask questions the smart way ?"
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,274
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 494
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Quick Java Question

 
0
  #5
Dec 23rd, 2008
Josh also make sure that your database server is capable of external access, MySQL is often installed as local and cannot be accessed from outside world
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 5
Reputation: abelarion is an unknown quantity at this point 
Solved Threads: 0
abelarion abelarion is offline Offline
Newbie Poster

Re: Quick Java Question

 
0
  #6
Dec 23rd, 2008
peter_budo: thanks for that tip! I contacted my host and made sure that my MySQL is able to be configured for external access - it can be (and I went ahead and configured it).

stephen84s: Thanks a lot for your response. It was really helpful!

Thanks guys,
-Josh
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 430 | Replies: 5
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC