Results 1 to 2 of 2
  1. #1
    XZen is offline Member
    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Post JDBC with several databases (mysql)

    Hello! :)

    I'm working with JDBC and MySQL and I have a question about it.
    As I understand, when we are creating connection, we should point url which looks like:
    Java Code:
    jdbc:mysql://localhost/mysql
    But if after some action I want to change the database (which is done in mysql as "USE another_database;"),
    should I create new connection for it or I can change the existing connection(if yes then how?)?

    Thank you, I will wait for a response
    Last edited by XZen; 12-10-2012 at 01:27 PM.

  2. #2
    farshad's Avatar
    farshad is offline Member
    Join Date
    Dec 2011
    Posts
    19
    Rep Power
    0

    Default Re: JDBC with several databases (mysql)

    hi XZen
    you must add dataBase JDBC Driver for example(ORACLE) to project and change Connection URL(Class.forName(" ") & DriverManeger.getConnection(" ")) to new Data Base.

Similar Threads

  1. Replies: 5
    Last Post: 09-25-2012, 06:36 PM
  2. Replies: 0
    Last Post: 03-03-2012, 02:01 AM
  3. JDBC Problem - com.mysql.jdbc.Driver
    By icu222much in forum Advanced Java
    Replies: 5
    Last Post: 11-22-2011, 05:54 PM
  4. MySQL/JDBC Mysql query output
    By thelinuxguy in forum Advanced Java
    Replies: 4
    Last Post: 02-13-2009, 02:57 AM
  5. help ... JDBC or PHP/MySQL
    By bluebarca in forum Advanced Java
    Replies: 1
    Last Post: 11-16-2007, 11:05 AM

Posting Permissions

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