I have been learning Java and know how to build simple applications. (I know about Applets, error handling, a bit of the API, etc.) However, what I am stumped on (sort of) is the networking part that I am now pursuing.
First of all: when I try sun's socket tutorial it eventually leads to the server side java script where it creates a socket and listens to a certain port. HOWEVER, when I run this script on my machine it presents an error that it cannot listen to port 4444... I have forwarded this port, shut down all firewalls but to no avail.
Anyway, thats not that big of a deal as my scripts will be running on a shared hosts and I won't have shell access so I won't be able to run a server side app (unless I had a browser pointed to the server-side applet on my shared host 24/7?? would this work? I still wouldn't want to do this as I cannot have my puter up 24/7.) Well, after looking at some java chat scripts, it seems that the ones that don't require you to run a server app constantly use PHP or another server side language to run the server instead... how would I do this?? I have been searching for some sort of tutorial on how to use Java and PHP together but to no avail.
Also, how would I use MySQL with Java? I assume I could do it if I could use Java+PHP but I really am stumped there..
If there is some tutorial explaining how this PHP as a server and Java as the client thing works please direct me towards that way, thank you,
lookup JDBC. It lets you communicate to the database directly through Java.
Have you tried a different port number? Perhaps there is already something running on that port.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)