Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: jdbc connection with phpmyadmin

  1. #1
    Junior Member
    Join Date
    May 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default jdbc connection with phpmyadmin

    Hello friends,
    i am trying to connect to mysql which available online through java with below code.
    I can fine a jar which contains the com.imaginary.sql.msql.MsqlDriver which is used the program.

    Can any body tell me how connect or whats the jar file needed for the below program and from where to download that jar file also.

    Code for your ref:
    import java.sql.*;
    class testjdbc {
     
    public static void main (String[] args) {
    try
    {
    // Step 1: Load the JDBC driver.
    Class.forName("com.imaginary.sql.msql.MsqlDriver") ;
    System.out.println("Driver loaded success");
    // Step 2: Establish the connection to the database.
    String url = "jdbc:msql://www.abc.com:1114/mysql";
    Connection conn = DriverManager.getConnection(url,"user1","password" );
    System.out.println("test connection success");
    }
    catch (Exception e)
    {
    System.err.println("Got an exception! ");
    System.err.println(e.getMessage());
    e.printStackTrace();
    }
    }
    }

    Thanks in advance!
    by
    Anand
    Last edited by Json; May 13th, 2010 at 02:22 AM. Reason: Please use code tags.


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: jdbc connection with phpmyadmin

    I think what you're looking for is MySQL :: Download Connector/J

    You should probably use that for connecting to a Mysql server. Look at MySQL :: MySQL 5.0 Reference Manual :: 20.3 MySQL Connector/J for information on how to use it.

    // Json

Similar Threads

  1. Connecting to Cache through JDBC - error
    By javavick in forum JDBC & Databases
    Replies: 0
    Last Post: May 6th, 2010, 06:34 AM
  2. JDBC API Test suite 1.3.1
    By prabhuaakannan in forum JDBC & Databases
    Replies: 0
    Last Post: March 26th, 2010, 09:57 AM
  3. Problem With JDBC
    By il912 in forum JDBC & Databases
    Replies: 7
    Last Post: October 17th, 2009, 03:59 AM
  4. JNDI - JDBC Integration problem
    By rangarajank in forum JDBC & Databases
    Replies: 0
    Last Post: September 29th, 2009, 06:07 AM
  5. JDBC Problem
    By seejay in forum JDBC & Databases
    Replies: 1
    Last Post: September 16th, 2009, 07:55 AM

Tags for this Thread