Problem with DSN - urgent ..please

hello there...

this is the snipet of my code... here " Applet " is trying to make a connection with the " MSSQL " ...

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Conncetion c = DriverManager.getConnection("jdbc:odbc:192.168.0.6&test", "myname", "mypassword");

here test is the DSN - it is a user DSN - am i doing the right thing here .. !!!

the exception i'm getting is -

" no suitable driver" at Connection c = .... etc..

under SQLException ..

am i doing it the right way.... do i have to specify the server IP... ? it makes no sense to me not pro

please do help me on this ... it's an immediate requirement... !!

thanks ..

premal

[726 byte] By [genghiz] at [2007-9-26 3:49:44]
# 1
>am i doing the right thing here .. Nope.connection string should look something likejdbc:odbc:MYDSN
jschell at 2007-6-29 12:34:39 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

> >am i doing the right thing here ..

>

> Nope.

>

> connection string should look something like

> jdbc:odbc:MYDSN

>

yeh.. i do understand that... but how would an applet recognize the IP address of the Server in this case when not specified.. !!! can u through some light on this.. because i have not worked with jdbc-odbc at all and this is my first time with MSSQL... !!!!

please do get back since the third party bridge i'm using needs Java Plugin as it works with jdk 1.2.x..

many a thanks ...

genghiz at 2007-6-29 12:34:39 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

>...applet recognize the IP address of the Server...i have not worked with jdbc-odbc

I don't believe you understand what is going on.

jdbc-odbc does NOT talk to the database. It talks to the ODBC shell that runs on the client. That talks to a ODBC driver (which has nothing to do with java) and that talks to the database.

The DSN specifies the information needed for the ODBC driver to talk to the database.

For this to happen the following MUST be true.

-ODBC must be installed on the client machine. This is always true for unix and almost never true for unix.

-A ODBC driver must be installed on the client machine. Usually the MS SQL Server driver comes when you install the MS SQL Server client, but it also comes with other MS products (like Visual Studio). I know of no MS SQL Server ODBC driver for unix.

Once you have the above on the client machine you can do one of two things:

-Create a DSN on the client machine using the ODBC applet in the windows control panel. If you do this use System not User.

-Use a DSN-less connection string. I couldn't specify the format for that but search this list as it has been answered before.

jschell at 2007-6-29 12:34:39 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...