- This topic has 26 replies, 2 voices, and was last updated 17 years, 10 months ago by architect-01.
-
AuthorPosts
-
architect-01MemberHi,
I am new to MyEclipse and wanted to use the JDBC-ODBC Bridge to connect to an Access database. How can I do this ? Is there a jar in the standard JDK to use with the database explorer ? Could you send me the steps on how to do this ? The documentation has no mention of this.Also on another thread. Any idea when the tutorials will be updated the current ones are very out of date with the MyEclipse 5.1 version.
Thanks for the help
Paul
Riyad KallaMemberPaul,
While this will technically work (follow the same DB doc, but instead use the default JDBC-ODBC connection) the JDBC-ODBC driver is horrible and won’t work for any real application development, like using hibernate or the like.
architect-01MemberThanks for getting back to me but i dont know how. The doc says pull in a driver jar. I do not know where it is ? I figured it would be terrible. We are just using this as a POC to get more MyEclipse usage here.
Riyad KallaMemberSorry I should have clarified. Because the JDBC-ODBC driver is already setup for you (it’s added by default in clean installs of MYEclipse) there is no driver to configure. You just setup a new connection, and when asked for the driver to use, you scroll down and select the JDBC-ODBC driver connection.
Also a heads up, if an operation you are performing fails, try checking your log file <workspace dir>\.metadata\.log, it might shed some light on why the operation failed, such as “Driver does not support XYZ” exceptions.
architect-01MemberI tried downloading the HXTT Access pure JDBC Database driver http://www.hxtt.com/access.html. I am still getting and error when i try to connect. Access_JDBC30.jar. How do I get this to work ?? Please get back to me when you can
Thanks
Riyad KallaMemberPaul,
I will outline each step.1) Start with the DB Tutorial here: http://www.myeclipseide.com/images/tutorials/quickstarts/dbexplorer/
2) You can skip all of section 4.1 because the driver you need (ODBC-JDBC) is already configured for you. You just need to select it (see screenshot)
3) Starting with section 4.2, you need to create a connection to your ODBC source using your ODBC-JDBC driver (see screenshot).
And after that, you just use the connection to connect to your DB, there isn’t much more to cover. Let me know if you get hung up on something specific.
Attachments:
You must be logged in to view attached files.
architect-01MemberHi,
I cannot use the JDBC-ODBC connection because my machine does not have admin rights. I have to use a plain JDBC driver for access. HXTT has one. I have been tring to connect though MyEclipse and keep getting the following error.Error while trying to login to database
Unable to create connection. Check your URLCould you give me an example of using Access with just JDBC.
I tried
jdbc:access:C:\java\data\Test.mdb but got the error.Does anyone have an example of this. I need to set this up to demo MyEclipse at my company.
Thanks
Paul
Riyad KallaMemberPaul,
I have never used HXTT’s driver, you would have to check with them and their documentation what the URL will be. If it’s a JDBC-ODBC driver like the one in the JDK is, then you need to provide a name that the ODBC datasource is being exposed as.
architect-01MemberHi Ryad,
Do you have an example of any JDBC driver connecting to Access that you could send me using MyEclipse ?
Thanks
Paul
Riyad KallaMemberPaul,
Unfortunately no. I don’t have access (or access to it, no pun intended) and asked around the office and the fellows I asked didn’t have it either, sorry.
architect-01MemberRiyad,
Could you give me an example of connecting to a HSQLDB database. If I cant use access I be able to use this ?
ThanksPaul
Riyad KallaMemberI’m happy to give you pointers.
1) You will start with this document: http://www.hsqldb.org/doc/guide/ch03.html
2) Because HSQLDB can run as an in-memory DB, it sort of works like Magic. You will setup a new driver, and select the hsqldb.jar file, which should auto-detect the JDBC driver class name and hit OK.
3) When you create a new connection using that driver, your connection string will look like:
jdbc:hsqldb:mem:memdbidwith name “sa” and blank password.
4) When you hit connect, you will immediately be connected to the DB instance (I believe invoking the driver actually creates the in-memory instance… it’s sort of slick).
And from there you should be fine. A lot of our users make use of HSQLDB and it seems to have a very robust JDBC driver so you should be able to do most of your work with it.
architect-01MemberCould you tell me how to connent to Apache Derby ? I have not been able to connect to any databases.
Riyad KallaMemberHow do you currently have Derby setup and how do you currently have your connection setup?
architect-01MemberHi Riyad,
I just just downloaded the Derby zip file, unzipped it into a directory to be simple. I could really use some help as I cannot use Access or ODBC to demo MyEclipse because that would change the Windows registry and our PC’s do not have admin rights.Could you provide and example of and unzipped derby and a connection string to it. I am not using the HSQLDB because I want to persist my sample data.
Thanks
Paul
-
AuthorPosts