How to access database file on CDROM from Java Programe??

Hello friends,
I am making online exam application.
I want my question database to be reside on CDROM.
but i am not getting any idea how to make DSN or static path that resolute the path that i have mentioned for CDROM.
basically i want to know how to access CDROM from Java Programe????
Thanks in advance
Navik Pathak

Once you mounted the CDROM (something maybe as /media/cdrom) as a file system (or assigned a drive letter to it like D: or F: or whatever), the files are accessible normally.

Similar Messages

  • How to extract .sit files(in MAC)  using java program

    Hi,
    please help me , i want to simple program for
    " how to extract .sit files(in MAC) using java program"
    that sit files same as zip files in windows..[                                                                                                                                                                                                                                                                                                                                   

    Thanks for reply...
    but i search in the google about this topic...there is no results will appear..
    the problem is "i have to run program in the MacOS like extract all the
    .sit(StuffIt) extension files. These sit files same as zip files in the windows... we have one tool called StuffIt Expander but it is 3rd party tool. but here requirement is i have to write my own program to extract all the files same as zip file program...
    please do the needful..i am waiting for ur reply,,,

  • Downloading unix archive file (.Z extension) from java program

    Hi,
    I am trying to download unix archive files with .Z extension from java program. When I use
    BufferedReader zReader = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
    and then read line by line and write it to file, downloaded file can't be decompressed. I tried to open it with winZip which supports .Z files but I get the message : Cannot open file, it does not appear to be a valid archive.
    How can I download file correctly?
    Any help would be appreciated.

    Hi,
    I am trying to download unix archive files with .Z
    extension from java program. When I use
    BufferedReader zReader = new BufferedReader(new
    InputStreamReader(urlConn.getInputStream()));
    and then read line by line and write it to file,How are you writing the file? Since it is binary data you need to be careful about using Reader/Writers, which are meant for character data. Look at using classes from the InputStream/OutputStream hierarchy.
    - N

  • How to remove Database Files and Backup from ASM

    Hi All,
    Oracle Database 11.2.0.3
    OEL 5.7
    We have a host for restore purposes.
    We execute monthly or quarterly restore operations to verify that I am able to restore a subset of the data in the given amount of time or to other purposes.
    I have a automated script to Clone the Database, but to Clone Database we need remove the old database from ASM before start this operation. I want remove only Database files and keep the configuration (such as oratab/network/ocr and so on).
    Question: There is a easy way to remove these files without connect on ASM or by using DBCA?
    Appreciate any helps.

    user12028775 wrote:
    Hi All,
    Oracle Database 11.2.0.3
    OEL 5.7
    We have a host for restore purposes.
    We execute monthly or quarterly restore operations to verify that I am able to restore a subset of the data in the given amount of time or to other purposes.
    I have a automated script to Clone the Database, but to Clone Database we need remove the old database from ASM before start this operation. I want remove only Database files and keep the configuration (such as oratab/network/ocr and so on).
    Question: There is a easy way to remove these files without connect on ASM or by using DBCA?
    Yes... there is a easy way. Use command DROP DATABASE.
    Use the DROP DATABASE command to delete the target database and, if RMAN is connected to a recovery catalog, unregister it. RMAN removes all datafiles, online redo logs, and control files belonging to the target database. By default, RMAN prompts for confirmation.
    Put this command on your script before clone your database:
    RMAN> CONNECT TARGET SYS@test1
    RMAN> STARTUP FORCE MOUNT
    RMAN> SQL 'ALTER SYSTEM ENABLE RESTRICTED SESSION';
    RMAN> DROP DATABASE INCLUDING BACKUPS NOPROMPT;Regards,
    Levi Pereira

  • How to access shared files on laptop from bb curve 3G?

    Hi friends,
    i have set a wi-fi network in my home and shared some files on my laptop. i want to access those files from my bb curve. plz help me out regarding this. i can connect to the network but not able to explore the laptop through network. plz help, thanx in advance..
    -- Adwait

    Hello adwait09 and welcome to the BlackBerry Support Community Forums.
    Currently the BlackBerry can access media files using Wi-Fi media sync.
    For more information on Wi-Fi sync check out KB23520
    Hope this answers your question.
    -HMthePirate
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • How to Access the Systems ipaddress in a java program

    Hi
       In a network The ip addresses of every system is changing.So that i want to know the ipaddresses of the system dynamically.
       I want a client program to  do that.
    And also i want to kno how to create a .exe file for java
    class file

    Hi
    In order to find the IP address of a system dynamically through a java programme Here is code...
        import java.net.*;
        public class check{
         public static void main(String args[])
                  try
    { InetAddress addr = InetAddress.getLocalHost();
        String ipaddress_as_text =addr.getHostAddress();
        System.out.println(ipaddress_as_text);
            catch(Exception ex){}
      For the 2 question ie to convert a .class file to a
    .exe file there are some tools available...
    I think the following link will be useful to you.
           http://duckware.com/jexepack/index.html 
        Thank you....

  • Need urgent help. Execution of .exe files by calling from java program

    This program can execute small .exe files which donot take inputs. But does not work for exe files that take input and just hangs. What could be the problem. If anyone helps me I would be very grateful.
    Server code :-
    import java.io.*;
    import java.net.*;
    public class Server1 {
         private Player[] players;
         private ServerSocket server;
         private ExecHelper exh;
         String command = null;
         String message = null;
         public Server1() {
              players = new Player[5];
              try {
                   server = new ServerSocket( 12345, 5 );
                   System.out.println("Server started...");
                   System.out.println("Waiting for request...");
              catch( IOException ioe ) {
                   ioe.printStackTrace();
                   System.exit( 1 );
         } //end Server constructor
         public void execute() {
              for( int i = 0; i < players.length; i++ )
              try {
                   players[i] = new Player( server.accept() );
                   players.start();
              catch( IOException ioe ) {
                   ioe.printStackTrace();
                   System.exit( 1 );
         public static void main( String args[] ) {
              Server1 ser = new Server1();
              ser.execute();
              System.exit( 1 );
         private class Player extends Thread {
              private Socket connection;
              private ObjectOutputStream output;
              private ObjectInputStream input;
              public Player( Socket socket ) {
                   connection = socket;
                   try {
                        input = new ObjectInputStream( connection.getInputStream());
                        output = new ObjectOutputStream( connection.getOutputStream());
                        output.flush();
                   catch( IOException ioe ) {
                        ioe.printStackTrace();
                        System.exit( 1 );
              public void run() {
                   try {
                        message = "Enter a command:";
                        output.writeObject( message );
                        output.flush();
                        do {
                             command = ( String ) input.readObject();
                             String osName = System.getProperty( "os.name" );
                             String[] cmd = new String[3];
                             if( osName.equals( "Windows 2000" )) {
                                  cmd[0] = "cmd.exe";
                                  cmd[1] = "/c";
                                  cmd[2] = command;
                             else if( osName.equals( "Windows NT" ) ) {
                             cmd[0] = "cmd.exe" ;
                             cmd[1] = "/C" ;
                             cmd[2] = command ;
                             Runtime rt = Runtime.getRuntime();
                             Process proc = rt.exec( cmd );
                             exh = new ExecHelper( proc, output, input);
                        } while( !command.equals( "TERMINATE" ) );
                   catch( Throwable t ) {
                        t.printStackTrace();
         } //end class Player
         public class ExecHelper implements Runnable {
         private Process process;
         private InputStream pErrorStream;
         private InputStream pInputStream;
         private OutputStream pOutputStream;
         private InputStreamReader isr;
         private InputStreamReader esr;
         private PrintWriter outputWriter;
         private ObjectOutputStream out;
         private ObjectInputStream in;
         private BufferedReader inBuffer;
         private BufferedReader errBuffer;
         private Thread processThread;
         private Thread inReadThread;
         private Thread errReadThread;
         private Thread outWriteThread;
         public ExecHelper( Process p, ObjectOutputStream output, ObjectInputStream input ) {
              process = p;
              pErrorStream = process.getErrorStream();
              pInputStream = process.getInputStream();
              pOutputStream = process.getOutputStream();
              outputWriter = new PrintWriter( pOutputStream, true );
              in = input;
              out = output;
              processThread = new Thread( this );
              inReadThread = new Thread( this );
              errReadThread = new Thread( this );
              outWriteThread = new Thread( this );
              processThread.start();
              inReadThread.start();
              errReadThread.start();
              outWriteThread.start();
         public void processEnded( int exitValue ) {
              try {
                   Thread.sleep( 1000 );
              catch( InterruptedException ie ) {
                   ie.printStackTrace();
         public void processNewInput( String input ) {
              try {
                   out.writeObject( "\n" + input );
                   out.flush();
                   catch( IOException ioe ) {
                   ioe.printStackTrace();
         public void processNewError( String error ) {
              try {
                   out.writeObject( "\n" + error );
                   out.flush();
         catch( IOException ioe ) {
                   ioe.printStackTrace();
         public void println( String output ) {
              outputWriter.println( output + "\n" );
         public void run() {
              if( processThread == Thread.currentThread()) {
                   try {
                        processEnded( process.waitFor());
                   catch( InterruptedException ie ) {
                        ie.printStackTrace();
              else if( inReadThread == Thread.currentThread() ) {
                   try {
                        isr = new InputStreamReader( pInputStream );
                        inBuffer = new BufferedReader( isr );
                        String line = null;
                        while(( line = inBuffer.readLine()) != null ) {
                                  processNewInput( line );
                   catch( IOException ioe ) {
                        ioe.printStackTrace();
              else if( outWriteThread == Thread.currentThread() ) {
                   try {
                        String nline = null;
                        nline = ( String ) in.readObject();
                        println( nline );
                   catch( ClassNotFoundException cnfe ) {
                   //     cnfe.printStackTrace();
                   catch( IOException ioe ) {
                        ioe.printStackTrace();
              else if( errReadThread == Thread.currentThread() ) {
                   try {
                        esr = new InputStreamReader( pErrorStream );
                        errBuffer = new BufferedReader( esr );
                        String nline = null;
                        while(( nline = errBuffer.readLine()) != null ) {
                             processNewError( nline );
                   catch( IOException ioe ) {
                        ioe.printStackTrace();
    Client code :-
    // client.java
    import java.io.*;
    import java.net.*;
    public class Client {
         private ObjectOutputStream output;
         private ObjectInputStream input;
         private String chatServer;
         private String message = "";
         private Socket client;
         public Client( String host ) {
              chatServer = host;
         private void runClient() {
              try {
                   connectToServer();
                   getStreams();
                   processConnection();
              catch( EOFException eofe ) {
                   System.err.println( "Client terminated connection ");
              catch( IOException ioe ) {
                   ioe.printStackTrace();
              finally {
                   closeConnection();
         } //end method runClient
         private void connectToServer() throws IOException {                                                                 
              System.out.println( "Attempting connection...\n");
              client = new Socket( InetAddress.getByName( chatServer ), 12345);
              System.out.println( "Connected to : "+ client.getInetAddress().getHostName());
         private void getStreams() throws IOException {
              output = new ObjectOutputStream( client.getOutputStream());
              output.flush();
              input = new ObjectInputStream( client.getInputStream());
         private void processConnection() throws IOException {
         while( true ){
                   try {
                        message = ( String ) input.readObject();
                        System.out.print( message );
                        InputStreamReader isr = new InputStreamReader( System.in);
                        BufferedReader br = new BufferedReader( isr );
                        String line = null ;
                        line = br.readLine();
                             output.writeObject(line);
                             output.flush();
                   catch( ClassNotFoundException cnfe) {
                        System.out.println( "\nUnknown object type received");
         } //end processConnection
         private void closeConnection() {
              System.out.println( "\nClosing connection");
              try {
                   output.close();
                   input.close();
                   client.close();
              catch( IOException ioe ) {
                   ioe.printStackTrace();
         public static void main( String args[] ) {
              Client c;
              if( args.length == 0 )
                   c = new Client( "127.0.0.1" );
              else
                   c = new Client( args[0] );
              c.runClient();

    pay close attention to the comments in this thread
    http://forum.java.sun.com/thread.jspa?threadID=769142&messageID=4383764#4383764

  • I'm about to transfer the contents of my existing HDD in my (dead PSU) iMac to another computer. I'm just wanting to know if and how I will be able to access my files and documents from the old hard drive once I've made the backup?

    I'm about to transfer the contents of my existing HDD in my (dead PSU) iMac to another computer. I'm just wanting to know if and how I will be able to access my files and documents from the old hard drive once I've made the backup?

    You are not going to be able to run your old system from the backup on this old computer as the hardware is incompatible.
    You need to get a new computer or a refurbished one.

  • How to use database file within jar archive

    Hi. I'm quite new in Java programming, and I'm wondering if what I did makes sense or not.
    In my applet I'm using a MS Access Database file, which is contained in the same Jar Archive like the Applet class file. I tried and tried to use this Database file directly but it wouldn't work. Than I read in some other forum that it is not possible to use the database file directly within the archive. First question: Is that true?
    Than I desided to extract the DB file in the init() method of my applet to the default temporary foulder. When the program is closed I use the destroy() method to delete it again. Everything works well now. But is this the typical way this is done?
    Thanks for help!

    Hi,
    here is the code which extracts the database file out of the jar archive (the same archive in which the class file is):
    //get the user temporary folder
    File TempFolder = new File(System.getProperty("java.io.tmpdir"));
    //create (empty) db file
    efile = new File(TempFolder, "steelSections.mdb");
    // if database file is not yet extracted
    if (!efile.exists()) {
    //get an input stream for the database file
    InputStream in = new BufferedInputStream(this.getClass().getClassLoader().getResourceAsStream(
    "FaST/db/steelSections.mdb"));
    //create an output stream for the db file on the file system
    OutputStream out = new BufferedOutputStream(new FileOutputStream(efile));
    //-Buffer to copy the data
    byte[] buffer = new byte[2048]; //buffer to copy the binary
    for (;;) {
    int nBytes = in.read(buffer); //read data
    if (nBytes <= 0)
    break; //no more data to read
    out.write(buffer, 0, nBytes); //write data
    out.flush(); //close out and in streams
    out.close();
    in.close();
    If you have the db file in an other jar archive file you need a referenze to the entry in the other jar archive. I'm not sure how to get this, but I'm sure you fill find a solution by searching in this forum...
    Good luck!

  • Opening windows "Access" database files through network

    Is there any way to open windows "Access" database files on my mac through a network to a windows machine? I have the windows for mac software but it doesn't include access.

    Hi,
    As per the description, I understand that your Office 2013 cannot open files through a network share directly.
    I would like to know that how many clients/users are affected by this in your environment. It could be some specific user account settings, that the Office applications are being affected by.
    I'd first suggest you try with a new Windows user profile, then verify result.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • I used a partitioned HDD for time machine, using a partition already containing other data files. I am now no longer able to view that partition in Finder. Disk Utility shows it in grey and "not mounted". Any suggestions of how to access the files?

    I used a partitioned HDD for time machine, using a partition already containing other data files. I am now no longer able to view that partition in Finder. Disk Utility shows it in grey and "not mounted". Any suggestions of how to access the files? Does using time machine mean that that partition is no longer able to be used as it used to be?
    HDD is a Toshiba 1TB, partitioned into two 500GB partitions.
    OS X version 10.9.2

    Yes, sharing a TM disk is a bad idea, and disks are cheap enough so that you don't need to.
    Now
    Have you tried to repair the disk yet

  • How to edit the existing data in the XML file from java programming.

    Hi all
    i am able to create XML file with the sample data as below from java programming.
    i need sample code on how to edit the existing data in the XML file?
    for example
    <?xml version="1.0"?>
       <mydata>
               <data1>
                         <key1>467</key1>
                        <name1>Paul</name1>
                        <id1>123</id1>
              </data1>
              <data2>
                         <key2>467</key2>
                        <name2>Paul</name2>
                        <id2>123</id2>
              </data2>
        </mydata>
    i am able to insert the data in the XML.
    now i need sample code on how to modify the data in the above XML file from the java programming for only key2,name2,id2 tags only. the remaining tags data in the XML file i want to keep same data except for key2,name2,id2 which are i want to modify from java code
    Regards
    Sunil
    [points will be always rewardable]

    hi
    u need a parser or validate the xml file for to read the xml file from java coding u need for this
    xml4j.jar u can download this file  from here
    http://www.alphaworks.ibm.com/tech/xml4j
    or we can use the SAX(simple API for XML)
    some sample applications for this
    http://www.java-tips.org/java-se-tips/javax.xml.parsers/how-to-read-xml-file-in-java.html
    http://www.developertutorials.com/tutorials/java/read-xml-file-in-java-050611/page1.html
    http://www.xml-training-guide.com/e-xml44.html
    let me know u need any other info
    bvr

  • How to upload a file in bdc  from application server

    how to upload a file in bdc  from application server

    Hi
    Check if this is useful and reward.
    PERFORM UNIX_UPLOAD.
    FORM unix_upload.
      DATA : lv_string(600) TYPE c.
      lv_string = p_fname. "p_fname is the filename  in path
    OPEN DATASET lv_string FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc <> 0.
        MESSAGE 'File Not Found' TYPE 'I'.
        LEAVE PROGRAM.
      ENDIF.
      DO .
        READ DATASET lv_string INTO gs_gfile.
        IF sy-subrc NE 0 .
          EXIT.
        ENDIF.
        APPEND gs_gfile TO gt_gfile .
        CLEAR  gs_gfile .
      ENDDO.
      CLOSE DATASET lv_string.
      CLEAR lv_string.
      DATA: lc_split TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
      LOOP AT gt_gfile INTO gs_gfile .
        SPLIT gs_gfile AT lc_split INTO
                                       gs_ipfile-field1                           
                                       gs_ipfile-field2.
      ENDLOOP.
    ENDFORM.                    "unix_upload
    here gs_ipfile is the same structure as your input file to upload
    and
    gs_gfile is the work area of the internal table containing characters as :
    TYPES  : BEGIN OF  ygs_gfile    ,
              data(600)             ,
             END OF    ygs_gfile    .
    *Internal table declaration for input file as text
    gt_gfile   TYPE STANDARD TABLE OF ygs_gfile  INITIAL SIZE 0 ,
    *Work area declaration for input file
           gs_gfile   TYPE ygs_gfile                                   .
    Thanks and Regards
    A Swarna

  • I have a  new iMac   cannot find how to access my files in Dreamweaver

    I cannot find how to access my files,  as I am now using Yosemite and it is all a different layout .
    can anyone get me started please
    Clicking on the cloud icon is no help

    Copy the entire /Music/iTunes folder to /Music/ on the new computer.
    That is all you need to do.

  • How did my pdf files get converted from 'open with Adobe Reader' to open with Adobe Acobat'?  And if I have a ''free'' Acrobat account why does it not open?  When I do click on the account it ask me to pay $89.99.  I never wanted Acrobat.  How can I get -

    How did my stored files get converted from 'open with Adobe READER' to 'open with Adobe ACROBAT'? How can I get them re-set to open with 'Adobe Reader'?
    Please reply to my e-mail:   [email protected]

    It sounds as if you downloaded Adobe Acrobat Pro. If you did, uninstall it. Then repair Adobe Reader.
    The free Acrobat account has no connection to any of this.

Maybe you are looking for

  • How can i add more than one portlet description in my provider.xml

    I already tested MyFirstPortlet developed using JPDK and is working fine.I add one more portlet description in the same provider.xml. But the new portlet is not getting displayed under the provider when i try to add it in my page. null

  • Extreme music software on vista

    Hi all. I have recently upgraded to vista 32 and with that have installed all the latest vista drivers for my xfi extreme music card. The problem is when using creative mediasource 5 v5.20.23 none of the buttons below the playback controls work (Audi

  • Automatic clearing in EBS

    Hi All When I am uploading the statement in FEBP through IDOC, I am getting error" F5263, difference is too large to clear". and not able to clear the posting are 2 i.e. subledger clearing not happening. If any come acrossed the same situation reques

  • Configuring P7.2 to auth against a specific org/suborg

    I've installed and configured AM7.1 (in legacy mode) on one machine, and created a suborg/realm that authenticates against an AD machine. I've verified this works by accessing am.machine.com/amserver?org=portal -- it presents me with the default scre

  • Too much executing time for a report

    Hi all, I am working on an issue where we have one report which is taking approximately 12-14 hrs to run, we just applied the service pack to our box and that is what creating the problem. the report is taking only 2 hrs to run on the box which doesn