Connection Object Class Overview

Hello Experts,
I created a class (cl02) and  the related characteristics (ct04) to be used for connection objects.  I wonder if there is a way to make the class field in the Assignments section pre-filled (or  pre-selected) when creating the connection object, so that the user won't have to select this class to enter the characteristics. I used the standard class indicator but I had no luck.
Thanks in advance!

Hi Eren,
You can do this kind of default value assignments into screen fields by implementing user exits.
Please have a look at exits EXIT_SAPLES55_001 to EXIT_SAPLES55_011 residing under component  XES55.
Regards,
Dilek

Similar Messages

  • Connection object in other classes

    i am writing a JDBC application. There will only be one user for this application.
    I want to know whether i am doing it the right way.
    Main program sets the connection to database and provides a static method getDBConnection()
    which returns a Connection object .
    All other programs have a public final variable which gets initialized with getDBConnection() method .
    Is there any other way other programs can get connection to database?
    I would appreciate any suggestions.
    Thanks

    sorry..
    all the other classes have public static variable which gets initialized with static method(getDBConnection) of main class(the method returns a connection)

  • How to store Connection object and call it from other programs.

    Hi,
    I am trying to connect to the database, store the connection object and use this connection object from other standalone java programs.
    Can any one tell me how to do this? I've tried in the following way:
    In the following program I am connecting to the database and saving the connection object in a variable.
    public class GetKT2Connection {
       public static void main(String[] args) {
          String url = "jdbc:odbc:SQLDsn;
          String dbUser = "sa";
          String dbPwd = "sa";
          Connection kt2conn = Connection connection = java.sql.DriverManager.getConnection(url, dbUser, dbPwd);
          if(kt2conn == null) {
             System.out.println("Database Connection Failure!");
          else {
             System.out.println("Connected to Database...");
         GetKTConnectionObj.storeKT2ConnectionObj(kt2conn);
    } Here is the program to save connection object in a variable.
    public class GetKTConnectionObj {
       static Connection kt2Connection = null;
       public static void storeKT2ConnectionObj(Connection conn) {
       kt2Connection = conn;
       public static Connection getKT2ConnectionObj() {
       try {
          return kt2Connection;
       catch(Exception e){
          System.out.println(e);
      return null;
    }Now from the following code I am trying to get the connection object that is stored. But this is throwing NullPointerException.
    public class Metrics_Migration {
      public static void main(String args[]) {
         try {
        java.sql.Connection connection_1 =   GetKTConnectionObj.getKT6ConnectionObj();
         catch(Exception e){
    }

    kt2Connection is null. You need to store it first, to make it not null. Otherwise it will stay null forever. And why on earth are you trying to do this THIS way?
    If you are running the two applications separately, it wont work either.

  • Object Class Invalid when downloading the pricing procedure from ECC to CRM

    Hi,
    I want to download the pricing procedure for that I have created the ZDNL_CUST_CND which contains only the following tablesT683, T683S, T683T and T683U.
    When I check in R3AM1 status is Red.
    The following Error have been found in SLG1
    •     Object class invalid
    •     Error in inbound data check
    Message no. CND_MAP120
    Diagnosis
    During the receiving inspection, serious errors were found in the consistency of the exchange object.
    System Response
    Data exchange is terminated
    •     Data exchange terminated     
    Message no. CND_MAP122
    Diagnosis
    Data exchange has been terminated due to serious errors. No exchanged data has been posted in the system.
    The following Error has been found in SMQ1
    •     R3AD_CONDITIONS     STOP
    Details of STOP
    Set by Host name: litldq; Transaction: ; Report: SAPMSSY1
    I have checked the connection, everything is perfect.
    What may be the problem?
    Thanks

    Hi,
      Please try to re-generate the adapter object (ZDNL_CUST_CND) services using trx.
    SMOGGEN
    . After this, try re-running the load.
    I assume that your CRM inbound mapping module are correctly coded. If the problem persists, try de-registering the R3AD_CONDITIONS inbound queue using trx.
    SMQR
    and then debugging the inbound queue from the same trx. after re-starting the load.
    Reward if this helps!
    Regards,
    Sudipta.

  • Oracle Access Manager Configuration : Cannot find the Person Object Class

    Hi,
    I am trying to install OAM , I am getting the following error when i am configuring the Identity server for the first time.
    1) I have installed OID. I am using one OID for both config and user data.
    2) I have installed Identity server and have modified the OID schema automically during installation.
    3) I have installed web pass.
    I have gone to the url: http://trn-ps-oid.oracle.com:7777/identity/oblix
    Here i gone to Identity System Console to configure Identity server.
    Following are the config data i have given
    Configuration DN : dc=mydomain,dc=com
    Search Base : dc=mydomain,dc=com
    Host : mypc.mydomain.com
    Port Number : 389
    Root DN : cn=orcladmin
    Root Password : *******
    Directory Server Security Mode : Open
    Is the Configuration data stored in this directory also : Yes
    Person Object Class : inetorgperson
    Auto configure objectclass : yes
    Group Object Class : groupOfUniqueNames
    Auto configure objectclass : yes
    After this I have clicked on the restart server button.
    It comes back to the page asking to enter Person Object class details.
    I Get the Error : Cannot find the Person Object Class.
    I have checked the object class in OID it is there, I have verified the connection details are also correct.
    Any Ideas what might be wrong.
    Earlier during setup i had to modify the OID schema, how do i check if this has been done.
    Any Ideas

    <?xml version="1.0" encoding="utf-8"?>
    <ValNameList
    xmlns="http://www.oblix.com"
    ListName="setup.xml">
    <NameValPair
    ParamName="mainOIS"
    Value="true"></NameValPair>
    <NameValPair
    ParamName="currentStep"
    Value="LDAP_CONFIG_CHANGES"></NameValPair>
    <NameValPair
    ParamName="status"
    Value="incomplete"></NameValPair>
    <NameValPair
    ParamName="whichDB"
    Value="OID"></NameValPair>
    <NameValPair
    ParamName="dataDirCopied"
    Value="TRUE"></NameValPair>
    <NameValPair
    ParamName="machineNo"
    Value="localhost"></NameValPair>
    <NameValPair
    ParamName="portNo"
    Value="389"></NameValPair>
    <NameValPair
    ParamName="rootDN"
    Value="cn=orcladmin,cn=Users,dc=mydomain,dc=com"></NameValPair>
    <NameValPair
    ParamName="ldapRootPasswd"
    Value="**************"></NameValPair>
    <NameValPair
    ParamName="securityMode"
    Value="Open"></NameValPair>
    <NameValPair
    ParamName="oblixUserDataSame"
    Value="Yes"></NameValPair>
    <NameValPair
    ParamName="searchBase"
    Value="dc=mydomain,dc=com"></NameValPair>
    <NameValPair
    ParamName="configDN"
    Value="dc=mydomain,dc=com"></NameValPair>
    <NameValPair
    ParamName="obClassPerson"
    Value="inetorgperson"></NameValPair>
    <NameValPair
    ParamName="defaultConfigForPersonOC"
    Value="true"></NameValPair>
    <NameValPair
    ParamName="obClassGroup"
    Value="groupOfUniqueNames"></NameValPair>
    <NameValPair
    ParamName="defaultConfigForGroupOC"
    Value="true"></NameValPair>
    <NameValPair
    ParamName="obOldClassPerson"
    Value="inetorgperson"></NameValPair>
    <NameValPair
    ParamName="obOldClassGroup"
    Value="groupOfUniqueNames"></NameValPair>
    </ValNameList>

  • How many Connections objects????

    Hi
    I am creating a GUI application which contains several GUI classes(e.g. frames and dialog boxes) which are instantiated depending on the choice of the user. I also have a Database class which contains the code which enables the connection to the database. The code creating the connection is within the constructor,therefore creating a connection whever I create an instance of the database class.
    Most of the GUI classes need to obtain or update information held in a database.
    Currently I create an instance of the Database class in every GUI class which needs to access the database. Obviously however every time a new database object is created, a new connection is also created.
    I am worried about all these database objects all containing their own connections.
    Should I have just one connection object in existence at any one time?
    If so,can I declare the Connection variable in the Database class as static?
    Any help/comments would be gratefully received.
    LGS

    From what I know, there should be no problem with maintaining multiple connections to the database. This is a property of the database itself, most allow about 256 connections. The only problem you face is a lost transaction. As long as you keep the queries serialized, you shouldn't encounter any problems.
    If you did want to only have one connection open... why not have another class for that (DBConn) and not instantiate a new connection in the constructor of your Database class. This way, each Database object can use the one connection by all referencing the DBConn object.
    Just a thought...

  • How to create an object class programmatically?

    Guys,
    I need your help. If possible with a simple example of how to do it.
    I need to create an aplication that read an specification of a repository type from a file and then creates it inside my BEA Repository. The problem are few:
    1 - How to Create an Object Class programmaticaly?
    I looked at documentation of ObjectClassOps but havent figured out how to do it.
    2 - How to Create a Property Definition programmaticaly?

    Sorry, ITypeManager only exists in 9.2. If you are working on 8.1, then the previous example becomes:
    RepositoryManager repositoryMgr = RepositoryManagerFactory.create();
    //connect to the repository
    repositoryMgr.connect();
    //get ObjectClassOps
    ObjectClassOps ocops = repositoryMgr.getObjectClassOps();
    ID repId = new ID();
    repId.setRepositoryName(repositoryName);
    PropertyDefinition[] pds = new PropertyDefinition[1];
    pds[0] = new PropertyDefinition(repId, "stringProp", null, Property.STRING, false, false, false, false, false, null);
    ObjectClass oc = new ObjectClass(repId, "myType", null, pds);
    oc = ocops.createObjectClass(oc);

  • Connection object as a key in a hashtable

    Hi,
    I am debugging some code where a Connection object is used as a key in a hashtable. Is this ok? Will the equals() and hashCode method be defined properly for a Connection object?
    Appreciate your help.
    Thanks!

    I am debugging some code where a Connection object is
    used as a key in a hashtable. Is this ok? Will the
    equals() and hashCode method be defined properly for a
    Connection object?First, answer the following question for yourself: how do you defined equality of Connections?
    If a class merely inherits the equals() implementation from Object, then equality is the same as referential identity. If that is Ok for you [which is the case in surprisingly many cases], there is no harm is using Connections as hashtable keys.
    Vlad.

  • Are there any shortcuts for creating Value Object Classes?

    Hi,
    I'm using a Remote Object to connect to my server
    (pyAMF/Django). I'm getting stuck with the creation of Value Object
    Classes. It doesn't seem very DRY to have a class on my server
    representing the data model and then have to recreate that class
    and all its properties in my Flex app.
    Are there any shortcuts for creating client side VOs from
    server side data?
    I was thinking about declaring an empty VO class in Flex, and
    then dynamically assigning/casting my Proxy object to that class.
    It seems like that approach may cause problems for the Flex
    compiler though.
    Any hints?
    Thanks!

    quote:
    Originally posted by:
    tptackab
    Oh man, do I feel your pain. I'm not sure what middle-tier
    technology you're using, but I'm using Java (w/Spring) and I
    absolutely hate having to create and maintain two sets of VO (aka
    data transfer - DTO) object for Java and Flex.
    One thing that has helped me in that area is a free tool from
    Farata Systems called
    DTO2Fx. If you're using Java and Eclipse, it's a great time saver.
    You simply install a (very lightweight) Eclipse plugin, add a
    single annotation to your Java VO classes, and it automatically
    generates your Flex VOs. It even creates a base and extended
    version of each VO on the AS3 side so you can add code to the
    extended VO without fear of having your changes overwritten when it
    regenerates your Flex VOs.
    Here's a like to thier
    PDF that
    gives instructions and a download link. I had it up and running in
    my application in less than 30 minutes!
    I'm using Python/Django serverside (PYAMF is my AMF
    serializer).

  • Webdynpro JCO Connection Object

    Hello,
    I have a Webdynpro Application with a View.
    In the View I call a RFC-Function at the R3 System.
    Now I want Debug the ABAP-Coding in the RFC-Function.
    Do anyone know how I get the JCO Connection Object from a Model Class ?
    I've checked this:
    wdContext.nodeEqui().getCurrentElement().model();
    It doesn't work,.....
    I want set the ABAP debuging ON with the Methode setAbapDebug(true)
    Thanks
    Mike

    Hello,
    Thanks,
    now it works. I've never told you, I used a Custom Controller in der View.
    Client myClient =
                wdThis
               .wdGetMyEquiController()
               .wdGetContext()
               .nodeBapi_Equi_Create_Input()
               .currentBapi_Equi_Create_InputElement()
               .modelObject()
               .modelInstance()
               .getJcoClient();
         myClient.setAbapDebug(true)
    Best regards,
    Mike

  • Getting the connection object in graph

    As part of Denormalizer component's Denormalize property where we have the logic of collapsing/denormalising the records we want to execute a sql query using PreparedStatement which requires Connection object.how do I get the connection object and execute a query.Can some one please share the java doc of the classes I can use.
    Do I get any class under org.jetel package which can be useful to get the Connection object.

    As part of Denormalizer component's Denormalize property where we have the logic of collapsing/denormalising the records we want to execute a sql query using PreparedStatement which requires Connection object.how do I get the connection object and execute a query.Can some one please share the java doc of the classes I can use.
    Do I get any class under org.jetel package which can be useful to get the Connection object.

  • Connection object is null returned

    Hi,
    I have created a datasource in Server Navigator for MySql database. Also in Admin Console I have given a JNDI name to this datasource. I am using this JNDI name. Application is able to lookup for this JNDI name but unable to get connection object. I am getting this exception while executing the application. This error is due to MySql database? I am getting lot of error while running any aplication using JSC. Is it really possible to develop any application using JSC early access? Any help on this is highly appreciated.
    Follwing part of exception which I am getting:
    Exception Details: javax.faces.el.EvaluationException
    javax.faces.FacesException: java.sql.SQLException: Error in allocating a connection. Cause: null
    Thanks
    Shailesh

    I also faced the same problem with oracle DB.
    I could workaround it as described in bug# 270767.
    It is because the appserver expects a datasource
    class implementation and creator UI expects a
    vanilla DB driver class.
    It could be resolved by completing design of your
    project and then deleting a the datasource based on
    the vanilla version of thedb driver and create a new
    datasource with the same name based on
    DataSource implementation.
    hth,
    Shanmu

  • Connection object is getting closed before the stored procedure is complete

    Hi Everyone,
    I am facing an issue where by the java connection object is closed before the stored procedure it is connected to is complete.
    I am not sure if the fault is in SP or Connection pool.
    After spending some time, i could able to figure out that the procedure is taking a tad more time for processing as there are over 1000 records in the database tables it is dealing with.
    Would that be a potential cause ? or Am i required to handle it in Java only ?
    I want to know what could be possible causes for this issue ?
    Please Help.
    FYI,
    The following are the logs which says,
    XYZ (Stored Procedure) : Start Time is 1349217771302 Procedure started here
    INFO >2012-10-02 18:43:09,935 [ConnectionPool]: Closing connection: DataSource [ABC](684)
    INFO >2012-10-02 18:46:03,512 DAO[main]: XYZ : End Time is 1349217963512 Procedure ended here
    Thanks in Advance.

    Hi ,
    Thank you all for your quick response.
    Well it's my bad i dint provide you any code to look into thinking that i am dealt with a gen issue and also i am too paranoid to post any code i am dealing with in the forum (i am sorry).
    But here is some information for you,
    Database : Oracle 10g
    Java: 1.5 version
    We are using only One connection object for the entire java backend process .
    The SP is of over 1000 lines of code which for obvious reasons i can't past it here but this morning i figured out an issue in SP where by a query taking way more than usual time to execute which led to SP's poor performance and also the reason for why it is taking very long time than usual.
    This query is a simple SELECT query where it is trying fetch over 2000 records from a table of over 3 million records. The execution time is over 30-40 seconds which is the root cause of SP's poor performance.
    When i eliminated this from the logic and ran the query it could able process (inserting huge volume around 5000 records of data) in 1 second instead of 3-4 minutes earlier.
    I tried to replicate this issue (which occurred in our production server) in my local system but no luck as there was no connection issue here but only the substantial time difference.
    We are using a customized connection pool which is as follows,
    I am not sure what's going on here because it seems to be greek and latin to me.
    What we are doing in our DAO is we are using method of the below ConnectionPool.getInstance(SCHEMA) to get the connection object.
    Looking forward to seeking advice from you on how connection pool in general works.
    public class ConnectionPool extends Thread
         private static final ConnectionPool me = new ConnectionPool();
         private Hashtable dataSources = new Hashtable();
         private static final int MIN_TIMEOUT = 0;
         private long timeOut;
         private Hashtable cons = new Hashtable();
         private Hashtable active = new Hashtable();
        private boolean trace = false;
         private ConnectionPool()
              registerDataSources();
              this.timeOut = PropertyManager.getIntProperty("connectionPool.timeOut", MIN_TIMEOUT);
              setName("ConnectionPool");
              setPriority(MIN_PRIORITY);
              if (timeOut > 0)
                   start();
         private void registerDataSources()
            dataSources.clear();
              Properties props = System.getProperties();
              String app = props.getProperty("X", "Y");
              for(Enumeration e = props.keys(); e.hasMoreElements();)
                   String key = (String) e.nextElement();
                   if (key.startsWith(app + ".connectionPool.dataSources.") && key.endsWith(".selector"))
                        String ds = key.substring((app + ".connectionPool.dataSources.").length(), key.length() - ".selector".length());
                        LogManager.logStatus("Registering [" + ds + "] (selector) " +
                                  props.getProperty(app + ".connectionPool.dataSources." + ds + ".selector"));
                        dataSources.put(ds,
                             new GenDataSource(
                                  ds,
                                  props.getProperty(app + ".connectionPool.dataSources." + ds + ".selector")));
                        continue;                    
                   if (!key.startsWith(app + ".connectionPool.dataSources.") || !key.endsWith(".server"))
                        continue;
                   String ds = key.substring((app + ".connectionPool.dataSources.").length(), key.length() - ".server".length());
                   try
                        LogManager.logStatus("Registering [" + ds + "] " +
                                  props.getProperty(app + ".connectionPool.dataSources." + ds + ".url"));
                        loadDriver(props.getProperty(app + ".connectionPool.dataSources." + ds + ".driver"));
                   catch (Exception se)
                        LogManager.logException(se);
                   GenDataSource genDataSource = new GenDataSource(
                             ds,
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".useMatrix", "false").equals("true"),
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".server"),
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".url"),
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".user"),
                             props.getProperty(app + ".connectionPool.dataSources." + ds + ".password"));
                   // Set the schema if schema is defined in settings.xml file
                   if (genDataSource != null && props.getProperty(app + ".connectionPool.dataSources." + ds + ".schema") != null ) {
                        genDataSource.setSchema(props.getProperty(app + ".connectionPool.dataSources." + ds + ".schema"));
                   dataSources.put(ds, genDataSource);
         public static Connection getConnection(String dataSource) throws SQLException
              GenDataSource ds = (GenDataSource) me.dataSources.get(dataSource);
              if (me.timeOut <= 0)
                   if (ds.getSchema() != null )
                        return updateSchema ( ds);
                   else
                        return DriverManager.getConnection(ds.url(), ds.user(), ds.password());
              String key = dataSource;
              Stack free;
              GenPooledConnection pc = null;
              synchronized (me)
                   if ((free = (Stack) me.cons.get(key)) == null)
                        free = new Stack();
                        me.cons.put(key, free);
                   if (!free.empty())
                        pc = (GenPooledConnection) free.pop();
                   if (pc == null)
                        if (ds.getSchema() != null )
                             pc = new GenPooledConnection("DataSource [" + key + "]",
                                                 updateSchema ( ds), free, me.active, me.timeOut, me.trace);
                        else
                             pc = new GenPooledConnection("DataSource [" + key + "]",
                                       DriverManager.getConnection(ds.url(), ds.user(), ds.password()), free, me.active, me.timeOut, me.trace);
                   else
                        pc.touch();
              LogManager.logStatus("Using " + pc);
              me.active.put(pc.id(), pc);
              return pc;
         public void run()
              for(;;)
                   try
                        sleep(60 * 1000);
                        synchronized (me) {
                             for(Enumeration e = cons.elements(); e.hasMoreElements();)
                                  Stack stack = (Stack) e.nextElement();
                                  for (int i = stack.size()-1; i >= 0; i--)
                                       GenPooledConnection pc = (GenPooledConnection) stack.elementAt(i);
                                       if (pc.isExpired())
                                            stack.removeElementAt(i);
                   catch (Exception e)
                        GenUtil.reportException(e);
         private static Connection updateSchema ( GenDataSource ds) throws SQLException {
              Connection con = DriverManager.getConnection(ds.url(), ds.user(), ds.password());
              if (ds.getSchema() != null ) {
                   String sql = "SET SCHEMA  " + ds.getSchema()+ ";";
                   LogManager.logDebugMessage("updating the Schema with sql statement " + sql);
                   PreparedStatement ps = con.prepareStatement(sql);
                   ps.execute();
                   ps.close();
              return con;
    }Thanks.
    Edited by: EJP on 5/10/2012 14:09: added {noformat}{noformat} tags. Please use them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Connection object repliction from isu to crm

    Dear Experts,
    I want to replicate the connection object from ISU to CRM could you tell me what are the configuration steps to be maintain in the CRM sytem so that the connection objects replicates to CRM.
    Thanks & Regards
    Boyz.
    Moderator note:  thread locked - no research done, available in other threads.

    Hello,
    Please see note  632749 for help with this issue.
    Please also check the foloowing points:
    1.  Are there any contract account entries existing in the table 'TFK_BUAG_REF' (IS-U System).
    2.  Check the contract account entries in your IS-U system with the transaction 'CAA3'. Are they existing ?
    3.  The buag class entry in table 'TFK_BUAG_REF' (IS-U System) is corresponding to the buag class entry in your business agreement (CRM system).
    I hope this is helpful.
    Regards
    Olivia
    Edited by: Olivia Walsh on Jan 24, 2011 5:40 PM

  • Is possible to make Serializable a Connection object?

    Hi I would like to know if is possible to make Serializable a Connection Object, I would like to save the Connection object into a text file so other class can read it and execute a proper query. If is possible how can I do it?.
    Thanks.

    Actually, if a class isn't already Serializable, you can't make it become Serializable reliably. Consider the following case:
    class A
        int x = 0;
        public void setX(int new_x) { x = new_x; }
        public int getX() { return x; }
    class B extends A implements Serializable
        int y = 0;
        public void setY(int new_y) { y = new_y; }
        public int getY() { return y; }
    public static void main(String arg[]) throws Exception
        B b = new B();
        b.setX(10);
        b.setY(12);
        someObjectOutputStream.writeObject(b);
    }The problem with this is that the implementation of Serializable by class B does not affect class A. In the above example, the ObjectInputStream that obtains the instance of B will have a y value of 12, but an x value of 0 (not 10).
    Thus, unless the Connection object implemented Serializable to begin with, it can't become Serializable. And, as the above post has described, the implementers of the Connection object would not make it Serializable as the local Connection object uses underlying O/S resources which cannot simply be transformed into a byte array.

Maybe you are looking for