Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. Multiple database connections

Multiple database connections

Scheduled Pinned Locked Moved Java
databasejavamysqlsql-serveroracle
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    devi g
    wrote on last edited by
    #1

    How to connect to multiple databases (like SQL server, mysql, oracle) through Java code.

    N 1 Reply Last reply
    0
    • D devi g

      How to connect to multiple databases (like SQL server, mysql, oracle) through Java code.

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Nirmala G wrote:

      SQL server

      JDBC will do it.

      Nirmala G wrote:

      mysql

      Look at JDBC Driver for MySQL

      Nirmala G wrote:

      oracle

      Again JDBC can be used here. What do you mean by connecting multiple databases? Do you mean a method where you can change the underlying database with minimum code change? If yes, abstract the database calls behind well defined interfaces. So you can change the code without affecting interface users. :)

      Navaneeth How to use google | Ask smart questions

      K 1 Reply Last reply
      0
      • N N a v a n e e t h

        Nirmala G wrote:

        SQL server

        JDBC will do it.

        Nirmala G wrote:

        mysql

        Look at JDBC Driver for MySQL

        Nirmala G wrote:

        oracle

        Again JDBC can be used here. What do you mean by connecting multiple databases? Do you mean a method where you can change the underlying database with minimum code change? If yes, abstract the database calls behind well defined interfaces. So you can change the code without affecting interface users. :)

        Navaneeth How to use google | Ask smart questions

        K Offline
        K Offline
        Ken Mazaika
        wrote on last edited by
        #3

        If you choose to use jdbc you'll have to download drivers for each specific database. I just wrote a post on how to dynamically load the database driver jar you need and connect to jdbc through it here[^].

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups