• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Java Application, MS Access database

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 23956
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about having two different DSN(s).
 
Rudy Rodriguez
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Swastik Dey

Yes

 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Guys
I will look into that information.

Rudy
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic