Java MS Access Database Connection without Admin rights - java

For a JAVA project I am working on there is a requirement that I use a Microsoft Access Database running on a computer where I do not have administrative priveleges.
So, I have the Access DB file all ready, and I started doing some research - but everywhere I look mentions the need to use the Admin Tools (or Control Panel) to "setup an ODBC connection", sadly it looks like I don't have access to any of these OS level configurations.
Is there any alternative I could use to access the database without the need to start configuring the Operating System (running Windows XP).
Any help would be appreciated.
Thanks,

Jackcess is a pure Java library for reading from and writing to MS Access databases.

The connction URL may contain the full ODBC information:
Connection con = DriverManager.getConnection(
"jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=c:/bd1.mdb"
);
No access to the control panel is necessary.

Related

How to download and install IBM AS/400 database on window?

My requirement is to download and install db2/400 database on windows but I am unable to find the download option which can install db2/400 database on my window laptop. I can find drivers to connect with the db2/400 database but please help me get db2/400 database to be downloaded?
It will be very helpful if I can get a freeware/trial version/sand-box env or a free virtual image of db2/400?
Edited:
I found this link: IBM Db2 for i. It has an option to download for windows 64-bit machine.
Is that what I am looking for?
No way.
There are no working IBM i emulators on x86 at the moment.
The original question has already been answered , in that at present there are no working free emulators for IBM-i for x86 architectures. But the question did not explain the real end goal.
The motiviation behind the question appears to be a request for a driver to access the i-series via jdbc without needing to purchase additional IBM licenses.
That requirement may be met by the open source jt400 driver available at http://jt400.sourceforge.net/
Additional clarification is that while the jt400 jdbc driver lets you access i-series database, it is not for accessing Db2-LUW databases (e.g. on MS-Windows). To access Db2-LUW databases you need the (cost free) IBM jdbc drivers. Other jdbc drivers are also available from third parties, with different requirements for licensing.
For additional awareness, you need to know that the SQL used for accessing i-series database can be different from the SQL used to access either Db2-LUW databases or Db2-for-Z/OS databases. It's possible to use standard SQL that will work on all variants of Db2 but you will then be unable to harness the additional platform-specific power offered by each Db2-variant to properly exploit the platform.
If you want to use a single jdbc driver that can connect to any of Db2-LUW or Db2-for-iseries, or Db2-for-Z/OS then you can use an IBM-supplied driver. With that IBM driver for accessing either i-series or z/os then you must either supply a license file, (i.e. purchase the license) or use a pre-existing Db2-connect-gateway at your site (which is separately licensed and does not require per-workstation licensing). You don't need licenses just for connecting to Db2-LUW databases.

oracle sql developer connection

I tried to install oracle sql developer in windows 7 32 bit for this first i install jdk 8 and then i install this file sqldeveloper-4.1.3.20.78-no-jre from oracle website .. then when i run sqldeveloper application it shows this
check image
then this shows create new connection now when i create connection it shows error
check image
how to solve this error?
You need to install Oracle Express Edition (XE) and set it up to run on your computer, on port 1521 - for your connection to work.
SQL Developer is just a client - there's no database there, unless you've put it there.
Apart the suggestions of #Nikita and #thatjeffsmith, I highly suspect the matter is that you are using the pre-existing user hr that you didn't create by yourself but that was created during installing your Oracle Express instance.
This user is by default locked. It must be unlocked by an administrator (for example SYSTEM user).
After unlocking hr user, don't forget to grant to it CONNECT and RESOURCE roles.
Find more details on this page.
You need to have a running database to use with SQL Developer. If you haven't installed it yet follow the official documentation. If you do have the database but can't connect to it, make sure that
The listener is up and running on the machine you're trying to connect to (in your case it's localhost)
You've provided the correct port number and SID

Deploy Java Desktop Application with MS Access DB

This is the first time I am going to deploy the Java Desktop Application with MS Access DB and discovered JAR package is not getting database access other then my development PC though I had the MS access DB in the same directory of the JAR file I have copied after Build the application. And I understand that I cannot connect MS access DB I created with ODBC connection of my PC. Now my question is
How can I deploy Java Desktop Application with MS access BD which will run in any computer where manual ODBC connection to the MS ACCESS DB for every computer will not require ?
I am not trying to connect MS access DB within a net work rather I am trying run this app where MS Access DB is already installed and my supplied DB will be with the JAR file and I want to access the DB I have provided from Java Front End Application.
Please help.
First you should get ODBC driver for Access database. Some computers may don't have it.
After you install that driver you should create ODBC Data Source on computer. I have no idea how to do it in Java, but ODBC Data Source configurations are stored in registry and you can add your Data Source.
Google "registry add odbc data source" or "Can I Create and Delete a DSN Using a Script" (second one is title of good article i found.
Probably you can access registry from java without any problems.
You can also use one of install-maker programs. Some of them have something like "Add Data Source" functionality.

Creating ODBC Data source java

I found this video which shows how to connect to access database :
http://www.youtube.com/watch?v=ujJ4H9RpC7c
My question is : Is it possible to create ODBC datasource programatically ?
or from command line or anything like that?
Thank you
It is not possible to create a windows ODBC DSN programmatically with pure Java. It is possible with C++ and other native approaches.
However, you can connect to an Access MDB file directly (via ODBC) using a JDBC URL of the form:
String jdbcUrl = "jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=c:/path/to/myaccessfile.mdb"
This way you do not need to have predefined DSN. You might also want to review the answers to this question:
How can I add a password to this JDBC:ODBC connection string that is trying to connect to an MS Access database
From the command line, you can use an utility named odbcconf.
I guess that if you need to do that programatically, you'll need to use WinAPI somehow.

How to bundle an Access database with a Java application

Hi recently I had created a Java application included database with Microsoft Access. I had wrapped it to jar file using eclipse. I pass the jar file to my friend to try to use it. But my friend told me that that is no database connection. How can i include the microsoft access in the jar file. Which mean when my friend double click the jar file it will auto configure the microsoft access database? is that possible?
Actually you don't need a package access with your application, since all versions of windows include a copy of the jet database engine. In other words you can use windows scripting to open up an access database on a windows computer without having installed ms access at all. The component or database engine part is all that you need to open in read those access database files.
Here a windows script to open a access database and write a column out to a text file:
Set dbEng = CreateObject("DAO.DBEngine.36")
strMdbFile = "C:\Docs\MultiSelect.mdb"
Set db = dbEng.OpenDatabase(strMdbFile)
strQuery = "select * from contacts"
Set rs = db.OpenRecordset(strQuery)
rs.MoveFirst
If rs.EOF = True Then
Quit
End If
strTextOut = "C:\t5.txt"
Set fs = Wscript.CreateObject("Scripting.FileSystemObject")
Set ts = fs.OpenTextFile(strTextOut, 2, True)
'2 = write, 1 = read
Do While rs.EOF = False
strOutText = rs("LastName")
ts.Writeline strOutText
rs.MoveNext
Loop
ts.Close
rs.Close
So there is no requirement to package or install the jet database engine width your application since that component is available in windows.
It's probably not too important, but I should point out that there's a distinct difference between ms access the developer's tool to let you write code, build forms, and build reports, and that of the database engine that access developers, vb6, vb.net and in your case Java can use to read an access database file. You don't need ms-access installed here, but only the database engine. That database engine is included with every copy of windows.
First of all: does your friend has a MS Access runtime, maybe he needs it? Does he configured the Microsoft Access ODBC Data Source?
Please take a look at following links: Jackcess - java library for reading and writing to MS Access file (no runtime needed), SQLLite - another file RDMS. Please consider to use the Apache Derby project - you can embed it into your application what gives you some advantages but requires more work. I don't know what app you want to implement so you will have to make a choice by yourself ;).
I don't think so. Your friend'll have to configure the odbc connection from the control panel. Also, I would suggest using a DB like derby or MySql than MS Access as the odbc driver is considered to have many bugs. Also using an embedded DB like derby wouldn't require your friend to configure anything at all.

Categories