• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Application, MS Access database  RSS feed

 
Rudy Rodriguez
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am working on a Java application that may use a MS Access database in one run of the application and another MS Access database in another run of the Java application.
I have set the variable for one of the databases on my computers administative tools, parameters.
Is there a way to programmatically in a java application to change the parameter in the admin tools settings, or be able to access the different database file at run time.

Thanks
RudeDude
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rudy Rodriguez wrote:Hi
I am working on a Java application that may use a MS Access database in one run of the application and another MS Access database in another run of the Java application.
I have set the variable for one of the databases on my computers administative tools, parameters.
Is there a way to programmatically in a java application to change the parameter in the admin tools settings, or be able to access the different database file at run time.

Thanks
RudeDude


Well, there are JDBC drivers for MS Access -- and when you create a connector using those drivers, you should be able to specify the database.

Henry
 
Rudy Rodriguez
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Henry
Thanks I have setup a database in the Admin settings, but I want to know if I need to set this for each database I am utilizing.
there maybe a time where i have to create a copy of a existing database in my application.
If I do this do I have to add it in my admin settings, or can this be done programmatically.

Thanks
Rudy
 
Swastik Dey
Rancher
Posts: 1815
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about having two different DSN(s).
 
Rudy Rodriguez
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess my main question is :
How do i add the newly created database to the Admin settings from a java application ?

If thats what I need to do for each database I am utilizing.

Thanks
Rudy
 
Swastik Dey
Rancher
Posts: 1815
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess, by adding to admin settings you mean a odbc data source mapped to an access database, and you wish to create this data source dynamically from your java code.
 
Rudy Rodriguez
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swastik Dey

Yes

 
Swastik Dey
Rancher
Posts: 1815
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DSN entries crated under the following key in windows registry

HKEY_LOCAL_MACHINE\ODBC\ODBC.INI

So, you need to find out how the entries are created there, and write your code create new values under that. But as far as my knowledge goes, dealing with registry is not a very safe thing.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to set up a DSN as long as you know the path to the DB file. Search in the pages linked from the JdbcFaq for an example of that.
 
Swastik Dey
Rancher
Posts: 1815
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf, this was new for me too. Although haven't used odbc driver for a long time.
 
Rudy Rodriguez
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Guys
I will look into that information.

Rudy
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!