DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 6 of 6

Thread: Strange

  1. #1
    Rajesh Guest

    Strange

    Dear Friends,

    Is there anyway to see the JDBC Drivers installed in my system ?
    for ex : i java odbc driver, and microsoft sql server jdbc driver...etc.,
    Can I see the list of all drivers ?
    Is there anyway to develop a java program to see this ?

    If anyone having any idea, please share ur ideas.
    Yours kind cooperation would be greatly appreciated.

    Thanks in advance
    Yours
    Rajesh




  2. #2
    Paul Clapham Guest

    Re: Strange

    Not really, because you don't "install" a driver. Basically you are asking
    to find all classes "in your system" -- does that mean in your classpath, or
    everywhere? -- that implement java.sql.Driver. And you can't easily know
    that without loading all the classes in your classpath. It just isn't worth
    the trouble, given that with a tiny bit of management you can know what
    drivers you have put on your system.

    PC2

    "Rajesh" <getfastreply@hotmail.com> wrote in message
    news:3ca0324c@10.1.10.29...
    > Dear Friends,
    >
    > Is there anyway to see the JDBC Drivers installed in my system ?
    > for ex : i java odbc driver, and microsoft sql server jdbc driver...etc.,
    > Can I see the list of all drivers ?
    > Is there anyway to develop a java program to see this ?
    >
    > If anyone having any idea, please share ur ideas.
    > Yours kind cooperation would be greatly appreciated.
    >
    > Thanks in advance
    > Yours
    > Rajesh
    >
    >
    >




  3. #3
    Rajesh Guest

    Re: Strange

    Dear Mr.Paul,

    Thank you very much for your reply.
    Yes day I got a reply from java forum.
    please have a look of this below program.
    If you need any help, please feel free to contact me at anytime.
    Thanks once again.
    Yours
    Rajesh


    import java.sql.*;

    public class DriversTest
    {
    DriversTest()
    {
    try
    {
    Class.forName("oracle.jdbc.driver.OracleDriver()");
    System.out.println("Connected to Oracle JDBC Driver");
    System.out.println("");
    }
    catch(Exception sqle) {
    System.out.println("Oracle JDBC Driver is not installed");
    System.out.println("");
    }
    try {
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    System.out.println("Connected to Microsoft SQLServerDriver");
    System.out.println("");
    }
    catch(Exception sqle) {
    System.out.println("Microsoft SQLServerDriver is not installed");
    System.out.println("");
    }
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Connected to Sun JDBC-ODBC Driver");
    System.out.println("");
    }
    catch(Exception sqle) {
    System.out.println("Sun JDBC-ODBC Driver");
    System.out.println("");
    }
    try {
    Class.forName("com.merant.datadirect.jdbc.sqlserver.SQLServerDriver");
    System.out.println("Connected to Merant DataDirect Driver");
    System.out.println("");
    }
    catch(Exception sqle) {
    System.out.println("Merant DataDirect Driver is not installed");
    System.out.println("");
    }
    try {
    Class.forName("net.avenir.jdbc2.Driver");
    System.out.println("Connected to Avenir JDBC Driver");
    }
    catch(Exception sqle) {
    System.out.println("Avenir JDBC Driver is not installed");
    }
    }
    public static void main (String args[]) {
    new DriversTest();
    }
    }

    "Paul Clapham" <pclapham@core-mark.com> wrote in message
    news:3ca0950d$1@10.1.10.29...
    > Not really, because you don't "install" a driver. Basically you are

    asking
    > to find all classes "in your system" -- does that mean in your classpath,

    or
    > everywhere? -- that implement java.sql.Driver. And you can't easily know
    > that without loading all the classes in your classpath. It just isn't

    worth
    > the trouble, given that with a tiny bit of management you can know what
    > drivers you have put on your system.
    >
    > PC2
    >
    > "Rajesh" <getfastreply@hotmail.com> wrote in message
    > news:3ca0324c@10.1.10.29...
    > > Dear Friends,
    > >
    > > Is there anyway to see the JDBC Drivers installed in my system ?
    > > for ex : i java odbc driver, and microsoft sql server jdbc

    driver...etc.,
    > > Can I see the list of all drivers ?
    > > Is there anyway to develop a java program to see this ?
    > >
    > > If anyone having any idea, please share ur ideas.
    > > Yours kind cooperation would be greatly appreciated.
    > >
    > > Thanks in advance
    > > Yours
    > > Rajesh
    > >
    > >
    > >

    >
    >




  4. #4
    Paul Clapham Guest

    Re: Strange

    You missed about 150 other drivers, including one I use regularly.

    PC2

    "Rajesh" <getfastreply@hotmail.com> wrote in message
    news:3ca11297@10.1.10.29...
    > Dear Mr.Paul,
    >
    > Thank you very much for your reply.
    > Yes day I got a reply from java forum.
    > please have a look of this below program.
    > If you need any help, please feel free to contact me at anytime.
    > Thanks once again.
    > Yours
    > Rajesh
    >
    >
    > import java.sql.*;
    >
    > public class DriversTest
    > {
    > DriversTest()
    > {
    > try
    > {
    > Class.forName("oracle.jdbc.driver.OracleDriver()");
    > System.out.println("Connected to Oracle JDBC Driver");
    > System.out.println("");
    > }
    > catch(Exception sqle) {
    > System.out.println("Oracle JDBC Driver is not installed");
    > System.out.println("");
    > }
    > try {
    > Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    > System.out.println("Connected to Microsoft SQLServerDriver");
    > System.out.println("");
    > }
    > catch(Exception sqle) {
    > System.out.println("Microsoft SQLServerDriver is not installed");
    > System.out.println("");
    > }
    > try {
    > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    > System.out.println("Connected to Sun JDBC-ODBC Driver");
    > System.out.println("");
    > }
    > catch(Exception sqle) {
    > System.out.println("Sun JDBC-ODBC Driver");
    > System.out.println("");
    > }
    > try {
    > Class.forName("com.merant.datadirect.jdbc.sqlserver.SQLServerDriver");
    > System.out.println("Connected to Merant DataDirect Driver");
    > System.out.println("");
    > }
    > catch(Exception sqle) {
    > System.out.println("Merant DataDirect Driver is not installed");
    > System.out.println("");
    > }
    > try {
    > Class.forName("net.avenir.jdbc2.Driver");
    > System.out.println("Connected to Avenir JDBC Driver");
    > }
    > catch(Exception sqle) {
    > System.out.println("Avenir JDBC Driver is not installed");
    > }
    > }
    > public static void main (String args[]) {
    > new DriversTest();
    > }
    > }
    >
    > "Paul Clapham" <pclapham@core-mark.com> wrote in message
    > news:3ca0950d$1@10.1.10.29...
    > > Not really, because you don't "install" a driver. Basically you are

    > asking
    > > to find all classes "in your system" -- does that mean in your

    classpath,
    > or
    > > everywhere? -- that implement java.sql.Driver. And you can't easily

    know
    > > that without loading all the classes in your classpath. It just isn't

    > worth
    > > the trouble, given that with a tiny bit of management you can know what
    > > drivers you have put on your system.
    > >
    > > PC2
    > >
    > > "Rajesh" <getfastreply@hotmail.com> wrote in message
    > > news:3ca0324c@10.1.10.29...
    > > > Dear Friends,
    > > >
    > > > Is there anyway to see the JDBC Drivers installed in my system ?
    > > > for ex : i java odbc driver, and microsoft sql server jdbc

    > driver...etc.,
    > > > Can I see the list of all drivers ?
    > > > Is there anyway to develop a java program to see this ?
    > > >
    > > > If anyone having any idea, please share ur ideas.
    > > > Yours kind cooperation would be greatly appreciated.
    > > >
    > > > Thanks in advance
    > > > Yours
    > > > Rajesh
    > > >
    > > >
    > > >

    > >
    > >

    >
    >




  5. #5
    Mark Guest

    Re: Strange


    Rajesh,

    Very helpful... thanks for sharing. I don't see a problem (as Paul seems
    to) with not including every possible jdbc driver. Chances are, if you need
    to use this code, you are probably looking for a specific one. Thanks again.

    Mark



    "Rajesh" <getfastreply@hotmail.com> wrote:
    >Dear Mr.Paul,
    >
    >Thank you very much for your reply.
    >Yes day I got a reply from java forum.
    >please have a look of this below program.
    >If you need any help, please feel free to contact me at anytime.
    >Thanks once again.
    >Yours
    >Rajesh
    >
    >
    >import java.sql.*;
    >
    >public class DriversTest
    >{
    > DriversTest()
    > {
    > try
    > {
    > Class.forName("oracle.jdbc.driver.OracleDriver()");
    > System.out.println("Connected to Oracle JDBC Driver");
    > System.out.println("");
    > }
    > catch(Exception sqle) {
    > System.out.println("Oracle JDBC Driver is not installed");
    > System.out.println("");
    > }
    > try {
    > Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    > System.out.println("Connected to Microsoft SQLServerDriver");
    > System.out.println("");
    > }
    > catch(Exception sqle) {
    > System.out.println("Microsoft SQLServerDriver is not installed");
    > System.out.println("");
    > }
    > try {
    > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    > System.out.println("Connected to Sun JDBC-ODBC Driver");
    > System.out.println("");
    > }
    > catch(Exception sqle) {
    > System.out.println("Sun JDBC-ODBC Driver");
    > System.out.println("");
    > }
    > try {
    > Class.forName("com.merant.datadirect.jdbc.sqlserver.SQLServerDriver");
    > System.out.println("Connected to Merant DataDirect Driver");
    > System.out.println("");
    > }
    > catch(Exception sqle) {
    > System.out.println("Merant DataDirect Driver is not installed");
    > System.out.println("");
    > }
    > try {
    > Class.forName("net.avenir.jdbc2.Driver");
    > System.out.println("Connected to Avenir JDBC Driver");
    > }
    > catch(Exception sqle) {
    > System.out.println("Avenir JDBC Driver is not installed");
    > }
    > }
    > public static void main (String args[]) {
    > new DriversTest();
    > }
    >}
    >
    >"Paul Clapham" <pclapham@core-mark.com> wrote in message
    >news:3ca0950d$1@10.1.10.29...
    >> Not really, because you don't "install" a driver. Basically you are

    >asking
    >> to find all classes "in your system" -- does that mean in your classpath,

    >or
    >> everywhere? -- that implement java.sql.Driver. And you can't easily know
    >> that without loading all the classes in your classpath. It just isn't

    >worth
    >> the trouble, given that with a tiny bit of management you can know what
    >> drivers you have put on your system.
    >>
    >> PC2
    >>
    >> "Rajesh" <getfastreply@hotmail.com> wrote in message
    >> news:3ca0324c@10.1.10.29...
    >> > Dear Friends,
    >> >
    >> > Is there anyway to see the JDBC Drivers installed in my system ?
    >> > for ex : i java odbc driver, and microsoft sql server jdbc

    >driver...etc.,
    >> > Can I see the list of all drivers ?
    >> > Is there anyway to develop a java program to see this ?
    >> >
    >> > If anyone having any idea, please share ur ideas.
    >> > Yours kind cooperation would be greatly appreciated.
    >> >
    >> > Thanks in advance
    >> > Yours
    >> > Rajesh
    >> >
    >> >
    >> >

    >>
    >>

    >
    >



  6. #6
    John Liew Guest

    Re: Strange


    Yes, you can write a java program that uses the javap command to locate the
    driver class.

    Eg:. javap -classpath <your classpath> <your fully qualified driver class>

    Capture the console output and you can parse the output to see if the driver
    class is on classpath on your machine.

    Regards,
    John Liew


    "Paul Clapham" <pclapham@core-mark.com> wrote:
    >Not really, because you don't "install" a driver. Basically you are asking
    >to find all classes "in your system" -- does that mean in your classpath,

    or
    >everywhere? -- that implement java.sql.Driver. And you can't easily know
    >that without loading all the classes in your classpath. It just isn't worth
    >the trouble, given that with a tiny bit of management you can know what
    >drivers you have put on your system.
    >
    >PC2
    >
    >"Rajesh" <getfastreply@hotmail.com> wrote in message
    >news:3ca0324c@10.1.10.29...
    >> Dear Friends,
    >>
    >> Is there anyway to see the JDBC Drivers installed in my system ?
    >> for ex : i java odbc driver, and microsoft sql server jdbc driver...etc.,
    >> Can I see the list of all drivers ?
    >> Is there anyway to develop a java program to see this ?
    >>
    >> If anyone having any idea, please share ur ideas.
    >> Yours kind cooperation would be greatly appreciated.
    >>
    >> Thanks in advance
    >> Yours
    >> Rajesh
    >>
    >>
    >>

    >
    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links