-
Java and MS access database connection
Hello everyone,
I have two problems:
1. I need to create tool that will create a test database and later on to populate it. The first problem is connected with creating the file. I do not know whether this is possible or not, but I want to create a file in which later on I can create tables and insert some values in the tables.
2. In this problem I want to input meaningfull values in the database columns? I do not know how this could be done.
Also at the moment I am have created the application and connect the application with a database file created from MS Access, with ODBC driver through the Control Panel.. What I mean to do is to create dinamicaly file according to the user input, and to populate that file with meaningfull data(values) later on. This is all done automatically, the user do not have to insert the values in the database, but through For loop at the moment I am inserting some kind of values, rows in the database, according the users input.
Any tips and help regarding any of the two above problems will be appreciated.
Thanks to everyone,
Borce.
-
You could make yourself an sql script for making the database and execute that
script from java using the Runtime class. If MS access has a command that
executes sql script files (don't know which..) you could do this:
(assuming the command is "execscript.exe" ans script file is called "myscript.sql"):
Runtime rt=Runtime.getRuntime();
Process p=rt.exec("c:\\pathtomsexecutablesfolder\\execscript.exe c:\\scripts\\myscript.sql");
p.waiFor(); // if required
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks