[JDBC][ODBC] How to compact access database from Java ?

Hello,
I'm developping a java applcation wich is connected to an MS Access file database.
For now, I don'y compact it but it would be better.
So How can I compact an access database from Java ?
thanks :)

Hi ypiel,
Try this:
1) Download JETCOMP.exe (freeware from Microsoft);
2) Put the following code in your app (assuming your database file name is: "DB.mdb"):
try {
File current = new File("DB.mdb");
File backup = new File("BACKUP.mdb");
if (current.renameTo(backup)) {
Runtime.getRuntime().exec("jetcomp -src:BACKUP.mdb -dest:DB.mdb");
} catch (Exception e) {
System.out.println(e.getMessage());
Best regards,
YT.

Similar Messages

  • How can I access database from FORMS 6i?

    Dear co-developers,
    I am new to developing and just installed Oracle forms 6i but when i try to access my database schema tables from forms 6i I get TNS error saying it could not resolve the service name. I need help in two things:
    1. I wanna know how to (and where to) make appropriate change in TNSnames.ora file or any other file to make things work.(I request u to explain in detail)
    2. what is the concept of oracle homes? Oracle forms 6i takes a new oracle home. And Oracle 9i Database takes another home.
    I have Oracle 9i Release 2 installed on windows XP pro.
    Thanx in advance and looking for a quick response.
    Mukesh

    hi there,
    i wanted to know from you that are you able to access your database from sql*plus?,if yes then i will give you the step by step info on how to configure your tnsnames.ora file automatically or manually.
    Automatic step
    1.Open net 8 easy config from start menu under programs where ur forms application shortcuts are installed.
    2.if the net 8 easy config doesnt open make a windows search for the file name symcjit.dll if the file is found rename it to any other name.
    3.if after renaming the file still you are not able to open it then you have to go by the manual way.which is concluded next
    4.now you have to add the database alias here.click on the add service and press next.
    5.provide your database name here in the service name text box.dont change the port number leave as it is.
    6.now again give your database in the sid text field.
    7.hit next and test you connection with scott/tiger or any other user.
    8.if the test is succesfull exit the configurator and test you forms for connectivity.
    first try this if nothing happens i'll post the manual method.

  • How to compact the database?

    Hi! Im new to java programming. I wish to seek help on how to compact the database using java.
    Any help will be greatly appreciated.
    thanks.

    You wish to compress the database in Java? Most databases have support for compression.

  • How to connect informix database from informatica through JDBC instead of ODBC

    How to connect informix database from informatica through JDBC instead of ODBC.

    Hi mate,
    You may get fast reply for this in informatica forums.
    Thanks
    http://mkashu.blogspot.com

  • How to create db conn for JDBC-ODBC Bridge for MS Access in ADF APP?

    Sir,
    How to create db conn for JDBC-ODBC Bridge for MS Access in ADF APP?
    Regards

    Hello Every Body!
    I succeeded in getting connect to the ms access database in adf application in jdeveloper as below:
    First in control panel to to admin tools and  go to data source(odbc) and create system dsn as bellow pic
    Then go to jdeveloper resources ide conn and then database and new database conn and then select jdbc-odbc briddge and then give custom jdbc url as bellow pic
    Cheers
    tanvir

  • How to connect Access database Dynamically

    Hi,
    I want to make connection to Access database with java with dynamically. I know to make connect to database in the following way:
    This way, I go to setting->controlPanel->Administrative tools->ODBC & then i select database & i use following code"
    public void  databaseconnect(){
        try{
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          connection =  DriverManager.getConnection("jdbc:odbc:student");
          output.append("Connection Successful\n");
        catch(ClassNotFoundException cnex){
          cnex.printStackTrace();
          output.append("Connection Unsuccessful\n"+cnex.toString());
        catch(SQLException sqlex){
          sqlex.printStackTrace();
          output.append("Connection unsuccessful\n"+sqlex.toString());
            catch(Exception ex){
              ex.printStackTrace();
              output.append(ex.toString());
    }But now i want to know the way to make connection to database dynamically. How this is possible? I want to make connection to database without selecting database from the Administrative tool? Is there anybody can help me?
    With regards
    Bina

    http://faq.javaranch.com/view?OdbcJdbcQuestions

  • How can I access iMessages from iTunes backup?

    I backed up my iPhone since I needed to backup a really large iMessage conversation and I read this was a way to do it
    Now I want to access it from my computer
    how can I do this?

    Anindan wrote:
    how can i access sms from itunes back up
    You will need a Backup Extractor program; there are many available. I use iScavenge for Mac, but there are many more. https://duckduckgo.com/?q=iphone+backup+extractor The one at the top of the search claims to be free, but it is not. Don't be fooled. I can't recommend for or against any of them, except iScavenge, which is OK.
    If you are technically inclined the backup is a SQLite database, so a SQLite browser can also open the backup.

  • How can I access files from a flash drive that were previously saved using a Windows computer? When I attempt to open the file on MacBook Pro, it is asking to "convert file to"; I also have Microsoft Word installed on the Mac as well.

    How can I access files from a flash drive that were previously saved using a Windows computer? When I attempt to open the file on MacBook Pro, it is asking to "convert file to"; none of the options I choose work. I also have Microsoft Office (with Word) installed on the Mac as well.

    Format the external drive as FAT32 or ExFAT. Both computers will then be able to read and write to it.

  • I brought up my itunes through a friends laptop. I signed out thinking I could get on my home computer and still have my iTunes accessible, how do i access them from this computer? HELP

    I brought up my itunes through a friends laptop. I signed out thinking I could get on my home computer and still have my iTunes accessible, how do i access them from this computer? HELP

    Copy everything from the old computer or your backup copy of your old computer, to your new one.

  • How do i access iCloud from 4S?

    how do i access iCloud from 4S?

    You don't using iPhone's Safari.
    I've heard that some other browser can.
    Best and free is use computer browser>
    https://www.icloud.com

  • How do i access icloud from my sony laptop. ive taken photos from my 5s iphone and dont know how to send to icloud then see them from laptop

    How do I access icloud from my sony laptop. do my photos go automatically to the cloud from my 5S iphone?

    Remote Wipe should solve the problem.

  • How do I access music from someone else's computer?

    How do I access music from someone else's computer? Do I have to configure my ipod to do so?
    How do I configure my ipod so that I can use it on any computer - Windows or Mac?

    Found the answer at last in the forum. Should get 'tune tools' from amazon.com

  • How do I access pictures from my iPhone saved in iCloud so that I can delete some of them from iCloud selectively?.

    How do I access pictures from my iPhone saved in iCloud in a computer so that I can see & delete some of them from iCloud to free up the free 5GB?.

    What Mac model do you have? What system version and iPhoto version are you running?  Do you meet these requirements:
    The following is for this Apple document: iCloud: Photo Stream FAQ
    What do I need to use Photo Stream?
    To use Photo Stream, including Shared Photo Streams, you need an iCloud account, compatible devices, and up-to-date software:
    iPhone, iPad, or iPod touch with iOS 6.0 or later
    Mac with OS X Mountain Lion v10.8.2 or later and iPhoto 9.4 or Aperture 3.4 or later
    PC with Windows 8, Windows 7, or Windows Vista (Service Pack 2) and the iCloud Control Panel 2.1 or later for Windows
    Apple TV (2nd generation) with Software Update 5.1 or later
    You can still use Photo Stream without Shared Photo Streams if your devices meet these requirements:
    iPhone, iPad, or iPod touch with iOS 5.1 or later
    Mac with OS X Lion v10.7.5 or later and iPhoto 9.2.2 or Aperture 3.2.3 or later
    PC with Windows 7 or Windows Vista (Service Pack 2) and the iCloud Control Panel v2.0 or later for Windows
    Apple TV (2nd generation) with Software Update 5.0 or later
    If you do then sign in to the same iCloud account that's on your iPhone on your Mac via the System/iCloud Preference pane as shown in this screenshot:
    Next setup iPhoto's Photo Stream preference pane as shown in this screenshot:
    The photos on your iPhone must be in it's Photo Stream so make sure the iPhone has enabled Photo Stream as shown below:
    Now you can select a photo in the Photo Stream section of iPhoto and control-click on it to delete it:
    OT

  • How do I access icloud from my computer at work?

    how do I access icloud from my computer at work?

    iCloud does not offer general file storage in the manner of iDisk, only syncing of iWork and Textedit files for access by your iOS devices. In Lion you go to the iWork section of iCloud and drag the files there in the Finder (they sync automatically on iOS); in Mountain Lion you can save directly to iCloud. But you can't store other types of files (other than by the odd workaround).

  • How do I access Crackle from Apple TV?

    How do i access Crackle from Apple TV?  when I click on the Crackle icon, the message instructs me to go to Crackle.com and enter access code, however there is no option for doing so on the website.
    thank you
    HWD

    thank you for reply.  no luck until.... rechecked the message on ATV and it actually says go to www.crackle.com/activate.  Note the */activate* on the end.  you have to enter that in the address line.  the Crackle home page will not get you there.  so I get to the activate page, enter the code and go back to ATV and Crackle and try again. this time i get the message that the code has expired!  unplug device, plug back in and try again and this time get new access code.  go back to activate page on computer, put in new code.  back to TV, try again, success!  I now have Comedians in Cars getting Coffee and I'm happy.
    thanks again.

Maybe you are looking for

  • Work center change in Service order not happening

    Hi Experts, I am facing a problem when i try to Call a function module in update task where the Function module contains a call to BAPI_ALM_ORDER_MAINTAIN without COMMIT WORK. This is done in order to update the Work Center while there are changes to

  • Have Tiger, but lots of old apps... should I pull the trigger?

    Yes, I know this is a popular question, but every situation is different and I haven't seen a definitive answer after browsing the forums for a while. I have the following hardware: 800MHz 17" flat-panel iMac 800MHz iBook ...and the following apps, n

  • Dynamic filename to payload

    Hi Guys, I have a file to IDoc scenario in which the Sender system places a file on FTP Directory at source side. PI picks up the file, generates a IDoc and take a "FileName" from the name of the source file. For example, If "Sender A" sends a file "

  • Transfering Music from iTunes on 2nd computer

    I have used my computer at home to download music and transfer music over to my iPhone. I am now at work and have iTunes on my computer ... is there anyway to add music to my iPhone from work without loosing all the music I already have on there? Jus

  • Jasper Report  Integration Examples

    Hi Can any one of you send examples/source/link that shows how to implement jasper report in JAVA .I tried it in google.but i won't wrok. A simple and detailed example that shows finally how a PDF is generated