Skip to main content

JDBC connection

1 reply [Last post]
appserver_user
Offline
Joined: 2006-10-17
Points: 0

Hi,

I have got MySQL database server installed and running on a different machine. Is there any way to connect to that database remotely?

I have added connector/driver for that database. i can connect and browse the database with host: "localhost" and port number. But when i specify the ip address of remote machine, it gives me error.

Can anyone help please.

cheers.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jr158900
Offline
Joined: 2005-04-13
Points: 0

Hi,
You can refer the Administration guide of GlassFish for integrating jdbc-drivers
http://docs.sun.com/app/docs/doc/819-3658/6n5s5nklk?a=view

You will be able to connect to remote databases.

Can you post your connection pool configuration [ in SJSAS_INSTALL_ROOT/domains//config/domain.xml ] ?

and

the exception messages related to this issue from SJSAS_INSTALL_ROOT/domains//logs/server.log ?

MySQL by default does not allow remote machines to connect to the database.
Refer the MySQL administration document
http://dev.mysql.com/doc/refman/5.0/en/adding-users.html

sample:
GRANT ALL PRIVILEGES ON *.* TO 'USER'@'REMOTE_MACHINE'
IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;

Thanks,
-Jagadish