Sending Connection Object over the Network using RMI

Hi,
How can a Connection object be sent over the network and run on another JVM. I need to hold connection object to execute processes one after other, that require Oracle connection without ever connecting again. I do not have J2EE container or webserver setup to hold connection/connectionpool,but need to run the process on command line. I am using RMI infrastructure to pass parameters/return values but connection object is not serializable and connot be marshalled and failing. Please explain, if there is another way using JDK 1.4
Sudheer

I think that what you want to do is connect to the database on the RMI server object, then use the server object from your remote clients to execute the processes you require to rrun.

Similar Messages

  • Sending Connection object over the network

    Hi,
    How can a Connection object be sent over the network and run on another JVM. I need to hold connection object to execute processes one after other, that require Oracle connection without ever connecting again. I do not have J2EE container or webserver setup to hold connection/connectionpool,but need to run the process on command line. I am using RMI infrastructure to pass parameters/return values but connection object is not serializable and cannot be marshalled and failing. Please explain, if there is another way using JDK 1.4
    Sudheer

    I don't believe this is possible. A connection object has a number of associated structures on the operating system, which generally makes it impossible to move. From a fundamental networking level, you also cannot, in general, cause a connection to machine1 to start communicating with machine2-- that would introduce all manner of security problems.
    Why don't you want to just create another connection on the other machine?
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Objects over the network

    is it possible to read in an object from a reader.println(Object x); type method?

    For your networking questions, first read:
    http://java.sun.com/docs/books/tutorial/networking/index.html
    (read "Overview of Networking" and "All About Sockets")
    That will get you started with a simple client/server package. Then go to the API (http://java.sun.com/j2se/1.4/docs/api/index.html) and look at the java.io.* package. You'll probably want to peek at the various Input/Output stream classes for using Objects (i.e. ObjectInputStream/ObjectOutputStream). It shouldn't be too difficult to figure out all you need from the above tutorial and the javadoc API. Once you get going, if you have problems, post specific code and/or exceptions here and it'll be easier for people to help.
    Good luck
    -Eric

  • App imitates sending out a virus over the network

    The last time I ran the Classic App called "Farallon Ping" which came with my old Farallon NC I bought years ago was back in 2003 or 2004 and I was told by IS of the University I was attending not to run it again as the app makes it appear to be sending out viruses over the network. The app is useful as it tells me my IP address and the IP address of every computer in my domain and offers many other features some of which that are lacking in the built in OSX utilities.
    I am at a much larger University these days and I was wanting to run this app for the features but not sure if I should.
    Is this post appropriate for this group and if so what do you say?
    Thanks

    Know nothing about Farallon Ping. Would MacPing at http://74.125.93.104/translate_c?hl=en&sl=nl&u=http://dartware.com/downloads/leg acy.html do the same thing?
     Cheers, Tom

  • Can object transfer over the network without serialization?

    Hi all,
    Can we send the objects over the network (from clent to server)
    without seraializing it?
    Thanks in advance

    Yes. By sending its values by any other means, like as XML.

  • Streaming audio file over the network w JMF. How to know when the file end

    Hi
    I am streaming audio file over the network using JMF. I want to be able to know when a file end so I can close the streaming session.
    Can some one please help
    Thanks

    If you put a ControllerListener on the Processor that's associated with generating the RTP stream, it'll generate an "EndOfMedia" event when the end of the file is reached.

  • Need to send object instances over the network

    I found no other way to implement a switch case to cast objects on both sides to solve my problem.
    Basically I need to send objects over a network protocol based on XML, the object is sent inside XML
    converted in base64, overall encoding of XML is utf-8.
    Let's suppose in my network there are 2 peers connected via socket.
    I have multiple instances of different types on both peers but I want to keep these instances
    synchronized. If something changes on side A, side B must receive that instance and replace
    it in the correct place (just one way, from A to B).
    When I receive such instance on B I want to cast it to it's proper instance
    of it's proper type and I am scratching my head on how could I implement this without some
    sort of unique ID table and switch case.
    If I had 1 instance per type could it be done easily?
    But I need to keep in synch many instances per type.
    Is there any dynamic casting that I can trigger based on some type/instanceID information
    I could send along the object?

    I found no other way to implement a switch case to cast objects on both sides to solve my problem.
    Basically I need to send objects over a network protocol based on XML, the object is sent inside XML
    converted in base64, overall encoding of XML is utf-8.
    Let's suppose in my network there are 2 peers connected via socket.
    I have multiple instances of different types on both peers but I want to keep these instances
    synchronized. If something changes on side A, side B must receive that instance and replace
    it in the correct place (just one way, from A to B).
    When I receive such instance on B I want to cast it to it's proper instance
    of it's proper type and I am scratching my head on how could I implement this without some
    sort of unique ID table and switch case.
    If I had 1 instance per type could it be done easily?
    But I need to keep in synch many instances per type.
    Is there any dynamic casting that I can trigger based on some type/instanceID information
    I could send along the object?

  • Sending Custom objects over RMI

    I am new to RMI and am having trouble sending customised objects over an RMI connection - I am trying to send an object of class DataFile which implements serializable, to a method on the server called loadPerformanceData(DataFile data). Here is the class DataFile:
    package org.twomey.fyp.loader;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    import org.twomey.fyp.mail.*;
    * Class to accept a File Object to prepare a File for Data Loading.
    * It reads a Data File line-by-line and provides the functionality
    * to insert line records into the database.
    * @version 0.1
    * @author Sean Twomey
    public class DataFile implements Serializable{
    /** Data Loading Date */
    private String date;
    /** Log from Loading Process */
    private StringBuffer log;
    /** Array of lines from file */
    private String file[];
    * Constructs a Data File from a specified File Object.
    * Accepts the File object and Data Loading Date
    * @param inputFile Inputted File Object
    * @param date Data Loading Date
    public DataFile(File inputFile, Calendar date){
         // Formats the date into a form acceptable to Oracle DBMS
         SimpleDateFormat form = new SimpleDateFormat("dd-MMM-yy");
         this.date = form.format(date.getTime());
         String line;
         int count = 0;
         try{
              RandomAccessFile inFile = new RandomAccessFile(inputFile, "r");
              // Read until end-of-file counting lines
              while((line = inFile.readLine()) != null){
                   count++;
              // Initialise array size to number of lines.
              file = new String[count];
              // Return to start-of-file
              inFile.seek(0);
              for(int i=0;i < file.length;i++){
                   // Read line into array
                   file[i] = inFile.readLine();
              inFile.close();
         catch(IOException ie){
              System.err.println("IO Exception: " + ie);
    * Load the entire set of records into the Database.
    * Data is loaded line-by-line. A Data Record object
    * is initilised to perform record loading and the
    * insertRecord method is called for each record.
    * A log is compiled from the insertion process
    * @return The Process Log
    public StringBuffer loadData(){
         String record[];
         log = new StringBuffer("");
         System.out.println("HERE");
         System.out.println(file.length);
         // From the org.twomey.fyp.loader package
         DataRecord objRecord;
         objRecord = new DataRecord(date);
         // Line-by-Line
         for(int i = 0; i < file.length; i++){
              // Split the record into fields which have been tab-delimited
              record = file.split("\t");
              // Each record feed must be 12 fields for valid loading
              if(record.length != 12){
                   System.err.println("Invalid Feed for line " + (i+1));
                   log.append("Invalid Feed for Line " + (i+1) + "\n");
              else{
                   log.append("Line "+(i+1) + " " objRecord.insertRecord(record) "\n");
         return log;
    * Send an EMail upon Completion the Performance Data Loading Process.
    * The mail sents the log compiled during Data Loading.
    public void sendMailReport(){
         // Use the Mail class from the org.twomey.mail package
         Mail email;
         String from;
         String alias;
         String to[];
         String subject;
         email = new Mail("chara.ucc.ie");
         to = getAddresses();
         from = System.getProperty("user.name") + "@chara.ucc.ie";
         alias = "Sheet Generator System";
         subject = "Performance Data Loader Report";
         email.sendEMail(from,alias,to,null,null,subject,log.toString());
    * Returns Email addresses from file.
    * The <b>mail.config</b> file is read line-by-line.
    * Each line entry should correspond to an email address.
    * @return Email addresses in a <CODE>String</CODE> array
    private String[] getAddresses(){
         RandomAccessFile inFile;
    String strLine;
    String addresses[] = null;
         int count = 0;
    try{
         inFile = new RandomAccessFile(new File("mail.config"),"r");
              while((strLine = inFile.readLine())!= null){
                   count++;
              addresses = new String[count];
         inFile.seek(0);
              for(int i = 0; i < addresses.length; i++){
         addresses[i] = inFile.readLine();
    catch(IOException ie){
         System.err.println("IOException: " + ie.getMessage());
    return addresses;
    } // end getAddresses
    } // end Class

    You seem to be reading the file into a string array, then trying to pass the object that did the reading.
    Two alternatives:
    o Just pass the string array object.
    o Create a data only object, passing the string array as an argument to the constructor

  • Send BufferedImage over the network

    I have already successfully setup a client/server connection. The issue, is when I send the BufferedImage over the network, it says:
    "Caused by: java.io.NotSerializableException: java.awt.image.BufferedImage"
    Can someone please tell me how to fix this?

    Like the exception say, BufferedImage is not serializable. You cannot serialize it. The problem will go away if you don't try to serialize it. Of course, that doesn't answer the question you really meant to ask... which I'll leave for somebody else.

  • HP photosmart C4700 cannot be connected over the network.

    my printer was recently unplugged and refuses to print. i have reinstalled all drivers and software but still cannot connect over the network. please help soon as i desperatley need to print off college work. this has happened before but reinstalling the drivers worked.

    Hi..
     try this one....
    Uninstall any remaining Hp printer program from your system..
    1. Click windows logo or start button- on the search box or run - type in %temp%, press enter
    2. look for the 7z folder on the TEmp folders.
    3. Open &z folder and look for util- open util look for ccc folder- open ccc folder loofk for uninstall3.
    4. Procedd to Uninstall level 3- restart the computer -go back to %temP% trhen delete tye 1st 7z folder-- to the same process for the remaining 7z folders- open util-ccc-uninstallL3- restart Pc and delete te 7z folder
    5. Once your'e done- go to add or remove programs or programs and features to uninstall remaining Hp printer software.. then restart you pc again..
    Follow these steps before re-installing the printer:
    Click Start , and then click Run . The Run dialog box opens.
    In the Run dialog box, type msconfig , and then press Enter .
    If the User Account Control window opens with the message 'Windows needs your permission to continue ,' click Continue to close the window.
    In the System Configuration window, click the Startup tab, and then click Disable All .
    Click the Services tab, click the Hide all Microsoft services checkbox, and then click Disable All .
    Click Apply , and then click OK .
    When prompted to restart the computer, click Restart later .
     Restart the network devicesFollow these steps to restart all the devices on the network.
    These steps include turning off the computer. Consider bookmarking this page for ease of reference.
    Press the Power button to turn off the product.
    Click Star,  click Shut Down , and then click Shut Down from the drop-down list.
    Turn on the wireless access point (router).
    Press the Power button  to turn on the product.
    Press the power button on the computer to turn it on.
    When the computer turns on, a System Configuration Utility message opens on the computer. Select the Do not show this message again check box, and then click OK .
    proceed to the installation.......then prove functionality...if successful continue these steps
    Re-enable startup programs and services
    Click Start ( ), and then click Run . The Run dialog box opens.
    In the Run dialog box, type msconfig , and then press Enter .
    If the User Account Control window opens with the message 'Windows needs your permission to continue ,' click Continue to close the window.
    In the System Configuration window, click the Startup tab, and then select the check box next to each program that should run when you turn on the computer. If a program should not run when the computer is turned on, leave the check box clear.
    CAUTION:Do not disable any Microsoft services.
    If no changes should be made to startup programs or services, click the General tab, and then select the Normal Startup checkbox.
    Click Apply , and then click OK .
    When prompted to restart the computer, click Restart .
    Although I am working on behalf of HP, I am speaking for myself and not for HP.
    Love Kudos! If you feel my post has helped you please click the White Kudos! Star just below my name : )
    If you feel my answer has fixed your problem please click 'Mark As Solution' and make it easier for others to find help quickly : )
    Happy Troubleshooting : )

  • Modifying JAR file using java.util.jar package  over the network

    Hello,
    I am modifying a JAR file programmatically using java.util.jar package. The time taken to save the contents to a local disk is very less (around 1 sec) . When I tried modifying the JAR from a remote machine over the network (from mapped drive or shared folder of WIN NT), the time taken to save is 15-20 times more.
    I am recreating the whole JAR while modifying. Is there any way to improve the performance. Or is it possible to write only the changed files?
    Thanks,
    Prasad Y S.

    When you "update" a jar file, you must always recreate it from scratch.

  • Sound problem while transimission over the network by using JMF API

    i had done an application which transmit audio and video over the network by using JMF API in JAVA. All my application work very well but i have a problem with the sound while i transmit it. this sound has a very bad quality (i am using AVReceive2.java) .
    has anyone an indication or solution for my problem
    it's very urgent, please help me.
    regards
    sar

    you can try modifing de Capture example from JMF Solutions.
    change this function:
    public int startCapture() {
         int result = -1;
         enableComponents(false);
         buttonStart.setLabel("Pause");
         buttonEnd.setEnabled(true);
         startMonitoring();
         try {
    processor.start();
    DataSource clone = Manager.createCloneableDataSource(datasource);
         MediaLocator ml2 = new MediaLocator("file://capture.mov");
    System.out.println("Content Type " + clone.getContentType());
    datasink = Manager.createDataSink(processor.getDataOutput(), ml2);
         datasink.open();
    datasink.addDataSinkListener(this);
         datasink.start();
    result = 0;
         } catch (Exception e) {
         System.err.println("DataSink Exception " + e);
    result= -1;
    Regards.
    Fernando

  • Before I had Mavericks I was able to print over the network to a Windows PC. Now I receive the message, "connection refused." Any ideas?

    Before I upgraded to Mavericks, I was able to print over the network to a printer attached to a Windows PC. Now, I receive the message, "connection refused." any ideas as to why this may be and what I can do about it would be appreciated.

    I had reconfigured all of the settings the same as in the previous OS X. The only thing I can think of that may be causing this is that the printer is an older Canon Pixma iP4300 and the Canon site doesn't have a driver for the new OS X. The Canon site said that the new OS X may supply the driver. Is there any one with the same experience as mine?

  • TS4268 When I send an imessage with wifi it send it from the original number I got with the phone before I ported my number over.  When I send an imessage on the network it comes from my own ported number.  How do I change this?

    When I send an imessage with wifi it sends it from the original number I got with the phone before I ported my number over.  When I send an imessage on the network it comes from my own ported number.  How do I change the imessage so that it comes from my own ported number?

    Yeah send it from your phone.
    Your computer has no knowledge of your phones phone number, it is not a phone.

  • HP Laserjet M1132 MFP is too slow over the network!

    Hi,
    My HP Laserjet M1132 MFP is too slow over the network!
    I have connect the printer to a windows XP 32bit SP3 using UBS port. The printer works fine on the local computer but when sharing it over the network it works too slow, for example with print test page it takes about 45 seconds to print and for other documents it takes much longer time.
    I have installed the latest driver form HP website and upgrade the firmware it the latest version.
    It happens on other Windows XP machines as well.
    I connected the printer to my laptop (Windows 7 64bit) and it works fine (No delays over the network) and it seems that this problem have some relations with the windows XP Driver.
    I have used local port trick on remote machines (instead of regular method) like this:
    ''add a local printer;
    'new port'
    'localport'
    \\XPcomputer\HPPrinterName as port name
    but still nothing!
    There is nothing wrong with the network, we use to use a Samsung printer on the same machines over the network with no problem.
    I Really appreciate your HELP!
    This question was solved.
    View Solution.

    BEHZAD_T, how is the printer connected to the network (wireless or Ethernet)? If it is slow wirelessly, I would suggest trying to connect the printer to your router with the Ethernet cord and install it to the networked computer that way.
    Another question is, relatively speaking, how close to your router are the Samsung printer and the HP printer? Depending on the distance (and what stands between the devices) there can be a lag between sending a print job and it being received by the printer.
    Let me know!

Maybe you are looking for

  • RMI server calling a method on a client object ?

    Hi All, I am writing a client - server application and my intention is to use RMI for comunication. When the client has to retrive datas from the server it's easy, but let's suppose that the server has to inform the client about some updates about th

  • I'm trying to reconnect my Time Machine.

    Hello, I'm trying to reconnect my Time Machine backup.  When I select my Time Machine I'm getting an error message "The disk image "kimby's iMac.sparesebundle" is in use.  Try ejecting the disk image.  How would I do this? I have no clue what they ar

  • 8.1.5 on RH 6.2

    Does oracle 815 install on Redhat 6.2? When I try I get nothing but jre errors using both jre v5 glibc and jre v5 libc5. Does anyone know how or do I downgrade to RH 6.1?

  • QT7 and Media Cleaner 6.01

    I have some problem on Media Cleaner 6.01 with QT7 does anyone has the same problem when encoding Mpeg-4 files ,

  • Does Time Machine verify backup

    Do you know if there's a way to get Time Machine to verify backups? I've always used backup programs in the past which verify the backup after it's done. But Time Machine seems to stop once a backup is completed. Also, after the first backup, is ther