DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004

    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,

  2. #2
    Join Date
    Nov 2004
    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
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.