• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

No connection: java.sql.SQLException: No suitable driver (MS Access)

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Getting my feet wet doing JAVA / jdbc. The username behind the DB is anonymous, with no password.
At the end is my simple Java class which posts the error :

"No connection: java.sql.SQLException: No suitable driver"
-----------------------------------------------------------------------------------------------
The Windows ODBC User DSN has this entry (among others):

Name      Platform   Driver

TNTDB     32-bit      Microsoft Access Driver (*.mdb, *.accdb)
-----------------------------------------------------------------------------------------------
Clicking on TNTDB (which is my DB) I see this:

Data Source Name TNTDB
Database: C:\...\Documents\TNTDB.accdb
-----------------------------------------------------------------------------------------------
I am using Access 2019, RAD 8.0 for JAVA
-----------------------------------------------------------------------------------------------



Thank you for taking the time to look!
 
Saloon Keeper
Posts: 6843
163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JDBC/ODBC bridge has been removed from Java years ago, in Java 8 I think. So unless you have access to a commercial driver (HXTT comes to mind) there is no way to use JDBC with Access. If you don't have a DB like Postgres or MySql around, you can use Java DBs like HsqlDB or Derby.
 
Saloon Keeper
Posts: 23282
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JDBC/ODBC bridge was never a very good option anyway. Fortunately, there are several JDBC drivers for MS-Access available. There are two caveats, however: None of them are from Microsoft (that I know of, anyway) and they may cost money. Take a quick web search and see which ones you like.

MS-Access is not a good database for Enterprise data storage. It's just one step about Excel (which, incidentally, also has third-party JDBC drivers). Access is not a multi-user database and should never be used for web application, for example, lest the database become corrupted.

More suitable alternatives include the databases Tim Moores mentioned. There is also SQLite, which is popular for Linux apps that don't need a server with all the bells and whistles. It's the database used in the Android OS.

In an Enterprise environment, of course, you may be stuck with MS-Access because some department(s) have home-built departmental applications. This can problematic, because desktop databases often don't get backed up, cannot be shared, and can get lost or stolen if they are hosted on a laptop. I've spent a lot of time migrating stuff like that to corporate databases and applications, but it's also possible to use ETL (Extract/Transform/Load) tools such as Talend or Hitachi Pentaho to ensure that they can be captured into the corporate database on some sort of regular schedule. Once there, you could use mainstream JDBC to work with the data.
 
Tim Moores
Saloon Keeper
Posts: 6843
163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had forgotten that there is actually a free JDBC driver for Access: https://sourceforge.net/projects/ucanaccess/
 
Robert Houston
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to the both of you for replying.
My choice of Access comes from a school assignment (2 yrs old) which I never attempted. I want to finish it up and figured Access was less trouble (and cheaper) than other DBs.
I'll read up on ucanaccess.
Bob
 
Tim Holloway
Saloon Keeper
Posts: 23282
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, Hi Bob! Yeah, you probably already have Access, and for study purposes, hooking to it from ucanaccess should do just fine. As I said, it's not something you'd do back in the Enterprise, but the mechanisms are the same, so it's OK for learning.
 
Robert Houston
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

Yeah this is a short project and not for anyone else to use.
Years ago I took an SQL course at FSCJ and we used MS SQL Server. It was a large product which offered a lot more than Access. I was glad when the class was over.

I'll be taking more classes so we'll likely cross paths again. I wish you a good 2021.

Bob
 
Robert Houston
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

I spent some time with Ucanaccess and its looks nice. I downloaded it, installed and tested it. I had a few problems so I sent all my info to sourceforge, and they told be that their latest version of Ucanaccess (5.0+) requires Java 1.8 or better.  I have 1.6  so it falls short and I cannot use it.

I have IBM's Rational Application Database 8.0 (a part of Websphere) . I took a class at FSCJ 2 years ago and all students got it as a part of the JAVA class. Later, I checked with IBM and they told me they want something like $5K for the latest version (includes support); naturally that is a NOGO in my world. Can you recommend a replacement that isn't as robust, but cheaper? I want something I can use for my own interest and not to be used to develop commercial code.

Thanks, Bob

PS is the MS ODBC back in play since I don't have Java 1.8?
 
Tim Holloway
Saloon Keeper
Posts: 23282
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why can't you pull down a more recent version of Java? Every release up until at least Java 11 is free, and later versions are generally available for personal use (disclaimer, I haven't checked what Oracle's most recent offerings are), Java 1.6 is indeed pretty ancient now.

There's also OpenJDK, which is open-source Java. Oracle hosts it, but doesn't own it. OpenJDK comes standard with most modern Linux distros (and maybe MacOS as well). Nothing comes "standard" with Windows, of course, but I'm pretty sure OpenJDK is also available there.

One thing to note is that unlike Microsoft products, Java maintains backwards compatibility, so a Java 11 compiler can not only (usually) compile code writeen for Java 6, it can also be instructed to accept source code that conforms to the limitations of Java 6 as well as producing classes for different Java releases.

I didn't know that IBM was bundling a database in with Websphere these days. I'm surprised, in fact, since there is a free version of DB2 available, and it's more than capable of doing your researches. I used it for a major production client back before they stopped paying me. There are also free versions of Oracle and SQL Server, Plus the reason for all of the preceding: the MySQL and PostgreSQL DBMS's that form much of the backbone of today's Internet. Sadly, while the commercial vendors got the "free" part, they missed out on the "user friendly" and "useful database utilities" parts.

You are sure that's a database, aren't you? Not the database GUI for RAD? Because there is a free Database Explorer for Eclipse.

Oh, and please, let the ODBC-JDBC bridge stay buried. It was awful even when there weren't any better options.
 
Robert Houston
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim,

What I have is RAD, but its part of Websphere. I was under the impression that it was tightly coupled with the Java version that comes with it. But maybe not, after reading your note. Are you saying that I can install a later version of Java and it'll run with RAD 8.0? If so then that might solve my issues. If this is possible how would I supplant Java v 6 with a newer one and still use RAD? Haven't a clue since it looks like a really big blob (not BLOB) to me.

Bob
 
Tim Holloway
Saloon Keeper
Posts: 23282
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RAD is IBM's proprietary version of Eclipse. I've not worked with it, since I haven't been in a position to receive the sort of discounts and freebies that big corporations and educators get for many years now. Eclipse was spun off as an open-source project by IBM somewhere around 2001, after which they renamed their own version to be part of the Rational family, but I'd be very surprised if RAD has changed that much. More probably, IBM added some candy to the stock Eclipse framework, since Eclipse isn't really so much a software program as it is an OSGi container with software development plugins.

At any rate, Eclipse does not have a built-in Java. Instead it has the ability to register as many different JDKs as you like. You can even set which version of Java you want to work with on a per-project basis. On the current version of Eclipse, the Window/Preferences dialog has a Java/Installed JREs element where you register and manage the different versions of Java. There should be at least the JDK 1.6 kit listed. Heck, I see I have jdk1.6.0_02 still registered myself, even though I think I deleted the actual files.

You might find it useful to simply go to Eclipse.org and download the latest version. It should be able to import your RAD projects. Eclipse comes in a number of "spins", so you'd want the JEE spin. Spins are nothing more than copies of Eclipse with specific plugins pre-installed, incidentally
 
Robert Houston
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim, I'll give it a go.
You're the mostest.

Bob
 
Robert Houston
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim,

I'm looking into new Eclipse, etc. and one site says to enter "Java -version" to see what I'm running. To my surprise it comes back with "Java 10.0.2 2018-07-17". Eclipse says Java SE 1.6. I'm confused. Does Windows use a different Java than Eclipse? Obviously I'm missing something.
 
Tim Holloway
Saloon Keeper
Posts: 23282
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, Windows doesn't come with Java.  Microsoft tried to hijack the language and lost big-time in court so they've refused to supply it with any of their products. But yes, Eclipse does run under its own Java version.

Java is a licensed product of Oracle Corporation (as opposed to OpenJDK) and as such is not pre-bundled with Eclipse or any other product that's written in Java. You're forced to download and install from java.sun.com yourself and as part of that process they make you explicitly agree to their software license.

I haven't actually looked closely, but my impression is that when you first launch Eclipse, it looks to see what versions of Java are already installed on your computer and picks one. At any rate, once the choice is made, it's remembered in an Eclipse configuration file and usually that's the end of it for me.

On the other hand, you might find this interesting: https://www.codejava.net/ides/eclipse/how-to-run-eclipse-under-different-version-of-jdk-or-jre

Note that the version of Java that Eclipse itself is running under doesn't need to be one of the ones that Eclipse is configured to use with projects.
 
Tim Holloway
Saloon Keeper
Posts: 23282
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, BTW, IBM folded most of their Java and related development products into Rational (for development) and Websphere. I usually take "Websphere" to mean Websphere Application Server (WAS), but MQSeries became Websphere MQ and similar

Marketing.  

Incidentally, IBM fielded its own JVM - the J9. It ran on both micro and full-sized platforms as I recall. Not sure if they still peddle it or not. IBM and Oracle both did a lot of experimenting with the JVM concept with the idea of doing interesting things with performance, memory management, Just-in-Time compiling and the JVM equivalent of running LPARs.
 
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic