Forum Stats

  • 3,827,397 Users
  • 2,260,770 Discussions
  • 7,897,225 Comments

Discussions

No support for OLE DB in Java

843859
843859 Member Posts: 35,905 Bronze Trophy
Hi,

How can it be that there is no support for OLE DB in Java. ODBC is no longer being developed and will probably soon die. All .NET programs insist on supporting only OLE DB or ADO.

What options do I have if I need to connect my Java program with a database behind an OLE DB interface? I can't be alone with this probelm.

Br,
Tom
«1

Comments

  • 843859
    843859 Member Posts: 35,905 Bronze Trophy
    Hi Tom,

    What are you really trying to accomplish? I'm not sure what you mean when you say a database is "behind" an OLE DB interface. Are you talking about Java accessing data directly through the OLE DB drivers provided by Microsoft and other 3rd party vendors or are you talking about something else?

    Just for fun, what would your answer be if I posed the question; why don�t Microsoft technologies allow you to connect through JDBC?

    To my knowledge there is no JDBC-OLEDB bridge but I think the need for that would be very small, but if there was a need and it was technically feasible, I�m sure some enterprising company would fill it.

    Java's JNI interface may allow you to achieve whatever you are attempting, but again I�m not clear on what exactly your goals are.

    There may very well be a solution that allows Java and something �behind� an OLE DB interface to successfully interact, and maybe I�m not the right guy to answer the question, but I think it would help if you could be a little more specific on the problem you are trying to solve.
  • 3004
    3004 Member Posts: 204,171 Green Ribbon
    Hi,

    How can it be that there is no support for OLE DB in
    Java. ODBC is no longer being developed and will
    probably soon die. All .NET programs insist on
    supporting only OLE DB or ADO.

    What options do I have if I need to connect my Java
    program with a database behind an OLE DB interface? I
    can't be alone with this probelm.
    Use a pure JDBC driver. The ODBC bridge driver was originally intended to bridge the initial gap between the many databases that had ODBC drivers and the few that had JDBC drivers available.

    At this juncture though there is a JDBC driver available for almost any database you can want. Many of these drivers are type 4 (pure Java) drivers as well.

    I do not think that ODBC will "die" any time soon however I do agree that eventually it will be replaced by OLE. This is the one reason I would suggest not to use the ODBC bridge driver if a suitable alternative is available.

    I wouold not hold my breath waiting for Sun to develop an OLE bridge driver. I think this is very unlikely to happen for a variety of reasons but mainly due to general lack of interest. As there is very likely a pure JDBC driver available for the database you are using there is no need to develop a further bridge type driver.
  • 3004
    3004 Member Posts: 204,171 Green Ribbon
    >
    There may very well be a solution that allows Java
    and something �behind� an OLE DB interface to
    successfully interact, and maybe I�m not the right
    guy to answer the question, but I think it would help
    if you could be a little more specific on the problem
    you are trying to solve.
    I would suspect that someone somewhere has a type 3 driver that provides Java to OLE usage. I also suspect one could use some sort of ActiveX wrapping tool like JACOB to do this.

    But to be honest I can't think of a good reason that one would want to use OLE.
  • 843859
    843859 Member Posts: 35,905 Bronze Trophy
    Microsoft doesn't support JDBC because they are trying to sell .NET (and not support J2EE). The vendor of the design managament system (that is now based on .NET) I have to work with only provides a OLE DB connection to the system database. So it's not like I have a choice!

    Is ODBC really the only "none-native" way to connect to a database (under Windows) in Java?
  • 843859
    843859 Member Posts: 35,905 Bronze Trophy
    Oh yeah, not a OLE DB connection but a OLE DB Provider :)
  • 3004
    3004 Member Posts: 204,171 Green Ribbon
    Microsoft doesn't support JDBC
    Yes they do. But anyway others support it as well.

    Rather than making us guess what database you are trying to talk to why don't you tell us. What type of database are you attempting to communicate with?
  • 843859
    843859 Member Posts: 35,905 Bronze Trophy
    Microsoft doesn't support JDBC because they are
    trying to sell .NET (and not support J2EE). The
    vendor of the design managament system (that is now
    based on .NET) I have to work with only provides a
    OLE DB connection to the system database. So it's not
    like I have a choice!

    Is ODBC really the only "none-native" way to connect
    to a database (under Windows) in Java?
    Again, without knowing what you want to do, or do it with, most of what can be written in this thread can only be presumptive, and it would be hit or miss that the responses address your actual problem. You haven't described any problem that can be addressed, and until you do, I don't believe you will receive any posts that will be of much help to you.

    J2EE and .NET are competing technologies from different vendors. So is Linux and Windows, but Microsoft supports Linux within Microsoft�s virtual server. So some interoperability does exist between Microsoft products and competing technologies. If you were forthcoming with some details of your issue it is possible that interoperability options are available to you.

    Are you looking for a solution, or just someone to agree with your premise that it can be difficult to blend JDBC and OLE DB into a single integrated application code base? If so, then I agree it is difficult to integrate JDBC and OLE DB into single application code base and that combination should probably be avoided.

    Having said that, from what little you have said, I see no problem in anything that you are trying to do. Whatever database you are using can be accessed using either J2EE/JDBC Java/JDBC or .NET technologies including SQL Server, MS Access, Oracle, Sybase, DB2/UDB, and many more. Your premise that you want to access these databases using OLE DB through Java is flawed and makes no sense, so that is not a concern and does not affect the ability of competing technologies (JDBC, OLE DB) to successfully access a single database instance. A networked database is application vendor neutral and doesn�t know or care what technologies are being used to access it.

    Here is a suggestion. Describe the problem you are having, what the functionality is you are attempting to develop, the technologies you are using and what you have tried so far that has not worked.
  • 843859
    843859 Member Posts: 35,905 Bronze Trophy
    Is ODBC really the only "none-native" way to connect
    to a database (under Windows) in Java?
    I don't know what you mean by "non-native".

    If you mean, non-JDBC, then no. At least some databases will let you use CORBA, and Java (allegedly) does CORBA just fine (I've never used it), and has been doing it for at least 9 years.
    http://www.javaworld.com/javaworld/jw-10-1997/jw-10-corbajava.html
    http://www.javaworld.com/javaworld/jw-10-2002/jw-1025-corba.html
  • 843859
    843859 Member Posts: 35,905 Bronze Trophy
    Hi,

    As I mentioned I'm struggling with a design management system that uses a closed database. The vendor of the program sells an OLE DB provider that can be used to access the database.

    My problem is that it seems like there is no way to access an OLE DB data source using Java, am I right? If there is any way I can connect to an OLE DB provider using Java, I would like to know :)

    Sorry if my question was incoherent.

    Br,
    Tom
  • 3004
    3004 Member Posts: 204,171 Green Ribbon
    Hi,

    As I mentioned I'm struggling with a design
    management system that uses a closed database. The
    vendor of the program sells an OLE DB provider that
    can be used to access the database.
    If by "closed" you mean propreitary then in a word, "hosed". The only possible solution is a type 3 driver (which is also a bridging type of driver) and it will connect to OLE on your behalf.

    Type 3 means middleware so the setup would end up being.

    Java -> Type 3 Driver (pure Java) -> Middleware -> (other driver OLE?) -> Your database
This discussion has been closed.