Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

public JDBC

 
Carsten Rasmussen
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have discovered that JDBC dont just load form one computer to another.
Examble my url contains 127.0.0.1 and my question is:
How do i code my statements so i will work on all computers with different isp's or
what do it take to be done.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65338
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the real IP address for the server.
 
Carsten Rasmussen
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can use REMOTE ADDR my router is blocking, and 192.168.3.4 dosnt work either.
maybe theres another way ???
 
Paul Clapham
Sheriff
Posts: 21579
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. The address in your JDBC URL has to be the address of the computer where the database server is running. There is no "other way". If you don't have access to that address from your program then that's a network problem which you cannot solve by Java programming.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why "in Java"? As Paul says, if you can't connect to the remote machine (by IP address or host name) then you need to speak to your network admin to find out why.

 
Carsten Rasmussen
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the code : http://qwil.dk:8080/test/index.php im the admin and there is connection to 3306 but i cant get anyone from outside network to veiw the chat.
I use PARAM for handeling host with a little PHP and it dosnt work please help
 
Carsten Rasmussen
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have only been programming JAVA for 2 days, im use to PHP
Im using:

Each time i call JDBC
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does:

getParameter("host")

return? Why are you passing the database server's IP address or host name as a parameter at all?

 
Carsten Rasmussen
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its should return <param name="host" value="ip_address"> but im not sure it does.
Because i dont know any other ways



Would be better but im not sure how to do it
 
Carsten Rasmussen
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made a solution now i just need someone to go to the url i gave and test it.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carsten Rasmussen wrote:I made a solution now i just need someone to go to the url i gave and test it.

Any reason you can't do that yourself?
 
Carsten Rasmussen
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i connect it uses 127.0.0.1 and works when you connect is uses another ip and i dont know if it works
my router is blocking all ports internal
so the reason is Netgear WNR-1000
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic