Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

remote jdbc connection

2 views
Skip to first unread message

Jeroen Douwes

unread,
Oct 9, 2001, 5:46:45 PM10/9/01
to
I use a MySQL database via the org.gjt.mm.mysql.Driver but only connecting
to the localhost succeeds.
To connect to the localhost I call:
Connection connection = DriverManager.getConnection(
"jdbc:mysql://localhost/BLACKLIST" );
I tried the following but they all threw an SQLException :
Connection connection = DriverManager.getConnection(
"jdbc:mysql://192.168.51.51/BLACKLIST" );
Connection connection = DriverManager.getConnection(
"jdbc:mysql://192.168.51.51:3306/BLACKLIST" );
Connection connection = DriverManager.getConnection(
"jdbc:mysql://lapt099/BLACKLIST" );
Connection connection = DriverManager.getConnection(
"jdbc:mysql://lapt099:3306/BLACKLIST" );
I can connect to the remote database via the commandline (mysql -h lapt099)
Can somebody give me a clue why?

Jeroen

Spider

unread,
Oct 10, 2001, 7:08:16 AM10/10/01
to
Hi Jeroen,

Normally, an applet is permitted to do anything on it's own server, not on
another server. I don't know the solution, but have the same problem at the
moment.
If somebody reacts outside the newsgroup, please also send it to me!

Greetz,

Bart


"Jeroen Douwes" <jdo...@xs4all.nl> schreef in bericht
news:9pvr4v$ddl$1...@news1.xs4all.nl...

Jeroen Douwes

unread,
Oct 10, 2001, 9:03:31 PM10/10/01
to
Hello Bart,

I have found the answer:
One of the mysql databases is called "mysql", this one contains a table
calles "user" with as data host, user, password and a lot of privileges of
that user:
Host char(60), User char(16), Password char(16), Select_priv enum('N','Y'),
Insert_priv enum('N','Y'), Update_priv enum('N','Y'), Delete_priv
enum('N','Y'), Create_priv enum('N','Y'), Drop_priv enum('N','Y'),
Reload_priv enum('N','Y'), Shutdown_priv enum('N','Y'), Process_priv
enum('N','Y'), File_priv enum('N','Y'), Grant_priv enum('N','Y'),
References_priv enum('N','Y'), Index_priv enum('N','Y'), Alter_priv
enum('N','Y')

with the following SQL statement you give all privileges to all users from
all hosts (default set to no privileges):
INSERT INTO USER VALUES
('%','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y')

On the mysql.com site are also some tools to edit this database.

Jeroen

"Spider" <cop...@home.nl> schreef in bericht
news:m2Ww7.38986$fo2.4...@zwoll1.home.nl...

B.A.J. Coppens

unread,
Oct 11, 2001, 6:05:08 AM10/11/01
to
Hi Jeroen,

I knew this was possible, but in fact that only works when you write an
application. An applet only has rights on its own host, so it isn't allowed
to access another server even if the server gives permittion.

bart


"Jeroen Douwes" <jdo...@xs4all.nl> schreef in bericht

news:9q2r2e$ldk$1...@news1.xs4all.nl...

jona...@aist-nara.ac.jp

unread,
Oct 18, 2001, 3:24:15 AM10/18/01
to

Hi guys,

I am working on PostgresDB, but facing the similar situation. I want to
use an applet to make remote DB connection.

It seems that the only way is to run another "proxy server" or rather a
type 3 driver that will handle communication with the database. This
driver will be sitting on the same machine as the webserver. The applet
will talk to the driver and the driver talks to the database. In this
case, there is no infringement of the java sandbox. The problem now is
that where can I get that driver, or do I have to program one myself.
Scott Oaks book on Java Security mentioned that one can easily be
programmed by a competent Java programmer.....hmmm, if so, what needs to
be done???

Anyone would like to add to this discussion???

Thanks.
Jon.

Ralf Schumacher

unread,
Oct 19, 2001, 4:48:37 AM10/19/01
to

<jona...@aist-nara.ac.jp> schrieb im Newsbeitrag
news:9qm02v$68s$1...@voyager.aist-nara.ac.jp...

>
> Hi guys,
>
> I am working on PostgresDB, but facing the similar situation. I want to
> use an applet to make remote DB connection.
>
> It seems that the only way is to run another "proxy server" or rather a
> type 3 driver that will handle communication with the database. This
> driver will be sitting on the same machine as the webserver. The applet
> will talk to the driver and the driver talks to the database. In this
> case, there is no infringement of the java sandbox. The problem now is
> that where can I get that driver, or do I have to program one myself.
> Scott Oaks book on Java Security mentioned that one can easily be
> programmed by a competent Java programmer.....hmmm, if so, what needs to
> be done???
>

You want to programm your own jdbc driver???

Hava a look at http://java.sun.com/products/jdbc/index.html
and search in the "driver database".

Ralf

0 new messages