Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004

    Unanswered: Connecting to local?

    Hi, i am newbie, so i am going to do my best to explain what i am trying to do.
    At university i have a DB, we use DB2...and we are doing some exercises where we connect to out DB through java, JDBC?

    well i cant access that server from home, so i installed MySQL and created the database on my PC (locally..right?)
    well, now i would like to test my java with the DB i have on my hardisk...
    How the heck?
    this is the code for my DB2 at uni, which is in my java at the moment...i dont know if it can help at all...thanks!!!!!!

    // load driver and connect to datbase
    String url = "jdbc:db2:CMPS2B26";
    String userid = "XXXXX";
    String password = "XXXXX";
    Connection con = DriverManager.getConnection(url, userid, password);
    Statement stmt = con.createStatement();

  2. #2
    Join Date
    Mar 2004

    For the connection string

    It has a load of different connection strings for different dbs. Being in college i'm sure you'll find it useful with future projects anyway

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts