Hi
  Thanks for choosing OpenSolaris. MySQL JDBC connector can be 
downloaded from
http://dev.mysql.com/downloads/connector/j/3.1.html

 You will need to unpack this downloaded file and set the 'jar' files to 
your CLASSPATH and that is all you need to do to connect to MySQL from 
Java. Here is a nice documentation from MySQL web site
http://dev.mysql.com/doc/refman/5.0/en/connector-j.html

To install MySQL server within OpenSolaris, you could do some thing like
pfexec pkg install mysql51

and to start the mysql server, you will need to do some thing like
svcadm enable mysql:version_51

thanks
- Sriram

Douglas Gaisie wrote:
> Hello there,
> am a student and love to move to opensolaris , i have install the 
> latest version and its running greate. i have create a java 
> application and want to connect it to mysql. when i run the 
> application i get an error. When you look at windows OS, there is a 
> place for you to set up the Data Source Name in the Administration   
> tool in control panel. is it possible for anyone to come to my aid  
> please....
>
> Here is the program
>
> "    
> import java.sql.*;
>
>    public class Connect
>    {
>        public static void main (String[] args)
>        {
>            Connection conn = null;
>
>            try
>
>
>            {
>              
>                String url = "jdbc:mysql://localhost/LuxuryCar";
>                Class.forName ("com.mysql.jdbc.Driver").newInstance ();
>                conn = DriverManager.getConnection (url);
>
>
>                System.out.println ("Database connection established");
>            }
>            catch (Exception e)
>            {
>                System.err.println ("Cannot connect to database server");
>
>
>            }
>            finally
>            {
>                if (conn != null)
>                {
>                    try
>                    {
>                        conn.close ();
>                        System.out.println ("Database connection terminated");
>
>
>                    }
>                    catch (Exception e) { /* ignore close errors */ }
>                }
>            }
>        }
>    }
>   
> thanks
>
> ------------------------------------------------------------------------
>
> _______________________________________________
>
>
> webstack-discuss mailing list
> webstack-discuss at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/webstack-discuss
>   

Reply via email to