On Wednesday 19 September 2001 14:32, Tom Meckna wrote:
> Hi Venu!
>
> Sorry for bothering you.  I belive I have the driver installed correctly
> but I dont understand what name I use when calling it from a java program.
> A example would be
>
> Class.forName(driverName);
> Ex from book
> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>
> I need the class name for the MySQL driver.  I am fairly positive I have
> set up the DNS name correctly.  Im just not sure what name I use.   Do you
> any suggestions.
>

Ok, if you want to use MyODBC through jdbc-odbc bridge then you need to 
specify the DSN name as the url in the getConnection method. Here is the 
simple procedure:

-- Create MyODBC DSN name as 'mydsn'
-- Load the jdbc-odbc bridge driver using
     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
-- Attempt to connect to MySQL server by loading MyODBC 
     String url = "jdbc:odbc:mydsn";
     Connection con = DriverManager.getConnection(url,"localhost","");

Will do the work for you. If the getConnection method fails, catch the 
exception and based on the exception alter your DSN entries.

Hope this helps you
Regards, venu
-- 
For technical support contracts, go to https://order.mysql.com/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /         Mr. Venu <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__          MySQL AB, Developer
/_/  /_/\_, /___/\___\_\___/   California, USA
       <___/   www.mysql.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to