Jerry McBride <email@example.com>
I just implemented a remote java client that accesses a
remote mysql server and while it's still fresh in my
head... I thought I'd share the high points with you.
First off... server side... using the mysql client named...
"mysql" be certain to setup a client that can accept
connections outside of local. Over here it sufficed to use
grant command line:
grant (your specific privilege
options) on (database) to mcbrides@'%' identified by
'password' with grant option;
If you need plain text passwords... do this:
grant (your specific privilege options) on (database) to
mcbrides@'%' identified by password 'password' with
What the "%" does is allow incomming
connections from anywhere from user mcbrides with the
Also, setup the same client to use
"mcbrides@localhost". I was getting random errors
from the jre about not being able to use localhost. This
fixed that.. :')
On the remote, client side your java/netrexx should
-- the above line specifies the MM jdbc driver.
-- the above line "decodes to:
stmt = con.createStatement()
Say'Caught unexpected error
end -- do
Once the above code snip opens the database on the server,
you can begin to process your sql commands as you normally
I just thought I'd share this with you guys. It wasn't so
obvious to me at first. What I'm doing is breaking
out a local mysql client and modifying it for remote
operations in a class C lan.
Really nice stuff. The neat part is, you can hardly tell
the dfference between local and remote operations.
I've got the complete source to this project and... boy...
the possibilities are endless.