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

Similar Messages

  • 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.

  • 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

  • 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.

  • 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

  • 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?

  • 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 : )

  • 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!

  • Fax over the network with HP LaserJet 400 ColorMFP M475dw

    Hi there, I was trying to send fax over the network with  HP LaserJet 400 ColorMFP M475dw, I have connected the printer/scan/fax on a wired network, just have 3 computers on it, all of them  can scan or print. But I can't find any option to just FAX from Microsoft Word or Adobe Acrobat Reader, going to File ---> Print ---> and select M475dw "FAx", I installed the lasted version of the drivers downloaded from hp.com and there's no way to install this multifunction printer as a FAX.
    So I can't see the FAX on Printers in the control panel of windows.
    I have never got an error message from any computer during the installation process either.
    Does anyone has an idea of what to do here?
    Thanks ahead.

    Thanks for your quick answer, I really appreciate it. But unfortunately, it didn't resolve my problem  
    Actually any of the workstations after complete the installation (with the last version of drivers downloaded just now from hp.com) can't recognize the HP LaserJet Pro 400 Color MFP M475dw, as a fax. I can print and scan over the network, or connecting the printer with a usb cable. I just can't see the icon "HP LaserJet Pro 400 Color MFP M475dw FAX" in Control Panel ---> Devices and Printers.   I did a full installation when I were asked during the installation process... I did then I custom installation and neither of them seems to work to me  
    This is very strange, it never happened to me with any other models of all-in-on (printer/fax/scanner)

  • Send wav files over a network

    Hi folks,
    I need to send sound files over a network. The files I'm wanting to send are wav files. I kinda have the mechanism that sends a file, but I am not sure how to convert wav files into something that I can easily send. Do I need to convert them into bytes, serialize them...etc I don't know.
    Can anyone please point me in the right direction? An example would be very much appreciated.
    Thank you,
    E

    hi
    this is very simple
    convert voice to bytearray
    just create one server socket and client socket then connect a sockets and transmit
    download sample from
    http://javasolution.blogspot.com/2007/04/voice-chat-using-java.html

  • Make a voice transmitter over the network?

    Hi i have read that it is possible in javax.sound to send or transmit live audio over the network or simply make a VoIP phone using the javax.sound api. I would like to ask if how can I be able to send the sound of the network. I have this step by step instruction about capturing and sending the voice in the network:
    • Use TargetDataLine for streaming capture
    • The TargetDataLine is wrapped in an AudioInputStream so that it can be converted to the network format with AudioSystem
    • a capture thread reads from the converted AudioInputStream and writes it to the network connection's OutputStream.
    Here is my code:
         audioFormat = getAudioFormat();
            DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class, audioFormat);
         targetDataLine = (TargetDataLine)AudioSystem.getLine(dataLineInfo);
         audioInputStream = new AudioInputStream(targetDataLine);I am not sure about this code but I am sure that there must be a targetDataLine associated in sending the voice. Please help me with this. Thank you.

    TargetDataLines are for reading from, SourceDataLines are for writing to, and AudioInputStreams are for loading/saving from a file.
    That said, there will be a TargetDataLine you can read from that's associated with your microphone. You create an AudioInputStream to read from the TargetDataLine (which is just an argument in the constructor), and then you can do...
    AudioSystem.write
    Give it the AIS associated with hte TDL, and you can either have it write it to a file or to an output stream. If that output stream was, say...an IP socket stream...then you could send it over the network to the other side...where you'd then need to construct an AudioInputStream to read it from the IP socket stream, and then to play it, you'd read some data from the AIS and write it to a SourceDataLine.
    Here are some resources to help you with the JavaSound stuff.
    JavaSound Example code (take a look at SimpleAudioPlayer & SimpleAudioRecorder in the Audio Playback and Recording section)
    [http://www.jsresources.org/examples/]
    Programmer's guide
    [http://java.sun.com/j2se/1.5.0/docs/guide/sound/programmer_guide/contents.html]
    And then just the normal Java SE6 API
    [http://java.sun.com/javase/6/docs/api/]

  • No JMS over the network

    hello,
    Im learning JMS and trying the examples from the tutorial. Both my SDK's are version 1.4.
    At home, I have a Linux machine directly connected to a win-XP machine. Im trying to connect the two machines as in the example "Running JMS Client Programs on Multiple Systems" I do exactly what the turorial states. I check, as recommended, that the JmsFactory does exist.
    What happens is somewhat dissapointing: when i issue the command "run SimpleProducer MyQueue queue 3", instead of messages get send over the network they end up in the own local queue at the side of the SimpleProducer. Both on the linux as on the win machine the same happens. I used both the IP-address and the netbios name of the remote machine in "ant add-remote-factory -Dsys=sys-name". The effect is the same.
    Anyone an idea what is wrong??
    Thank i.a.

    hi!
    i went to bed frustrated, turned on my computer and now this comes up:
    I try to lookup the connection factory with this code:
    try {
    connectionFactory = (ConnectionFactory)
    jndiContext.lookup("EarthQueueConnectionFactory");
    if (destType.equals("queue")) {
    dest = (Queue) jndiContext.lookup(destName);
    } else if (destType.equals("topic")) {
    dest = (Topic) jndiContext.lookup(destName);
    } else {
    throw new Exception("Invalid destination type" +
    "; must be queue or topic");
    } catch (Exception e) {
    System.out.println("JNDI API lookup failed: " +
    e.toString());
    System.exit(1);
    This is the error it returns:
    C:\j2sdkee1.4\doc\tutorial\examples\jms\simple>run SimpleProducer MyQueue queue 1
    Destination name is MyQueue, type is queue
    18-feb-2003 11:35:52 com.sun.jms.ConnectionFactoryImpl establishRemoteReferences
    SEVERE: ConnectionFactoryImpl: Failed to lookup or connect to JMS service because: org.omg.CORBA.OBJECT_N
    OT_EXIST: vmcid: SUN minor code: 202 completed: No
    18-feb-2003 11:35:52 com.sun.jms.ConnectionFactoryImpl establishRemoteReferences
    SEVERE: ConnectionFactoryImpl: Failed to lookup or connect to JMS service because: org.omg.CORBA.OBJECT_N
    OT_EXIST: vmcid: SUN minor code: 202 completed: No
    Exception in thread "main" java.lang.NullPointerException
    at com.sun.jms.client.ConnectionImpl.invokeRemoteCreateConnection(ConnectionImpl.java:161)
    at com.sun.jms.ConnectionFactoryImpl.createConnection(ConnectionFactoryImpl.java:314)
    at com.sun.jms.ConnectionFactoryImpl.createXAConnection(ConnectionFactoryImpl.java:468)
    at com.sun.jms.ConnectionFactoryImpl.createXAConnection(ConnectionFactoryImpl.java:444)
    at com.sun.jms.connector.ra.JMSConnectionFactoryAdapter.createConnection(JMSConnectionFactoryAdap
    ter.java:129)
    at SimpleProducer.main(Unknown Source)
    MyQueue exists and my j2eeadmin -listJmsFactory looks like this:
    JmsFactory
    < Connector Resource : jms/TopicConnectionFactory, jmsra.rar, , , javax.jms.TopicConnectionFactory
    Properties: NONE >
    < Connector Resource : jms/QueueConnectionFactory, jmsra.rar, , , javax.jms.QueueConnectionFactory
    Properties: NONE >
    < Connector Resource : EarthQueueConnectionFactory, jmsra.rar, , , javax.jms.QueueConnectionFactory
    Properties: >
    I have really no clue what is wrong. Can someone help me please????

Maybe you are looking for