Exforsys
+ Reply to Thread
Results 1 to 2 of 2

Connecting to a Database

This is a discussion on Connecting to a Database within the Java forums, part of the Programming Talk category; Database - JDBC (java.sql) Connecting to a Database This example uses the JDBC-ODBC bridge to connect to a database called ...

  1. #1
    lokeshm is offline Member Array
    Join Date
    Apr 2005
    Answers
    83

    Connecting to a Database

    Database - JDBC (java.sql)
    Connecting to a Database

    This example uses the JDBC-ODBC bridge to connect to a database called ''mydatabase' '.

    try {
    Class.forName( "sun.jdbc. odbc.JdbcOdbcDri ver");
    String url = "jdbc : odbc:mydataba se";
    Connection con = DriverManager. getConnection( url, "login", "password");
    } catch (ClassNotFoundExcep tion e) {
    } catch (SQLException e) {
    }

    Last edited by lokeshm; 12-13-2006 at 05:03 AM.

  2. #2
    caradoc is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    122
    This example was very useful for connecting to database. But can you kindly explain me in detail what is JDBC-ODBC Bridge. I do not have detailed idea about this concept and its usage.


Latest Article

Network Security Risk Assessment and Measurement

Read More...