Connection element

I am creating a class to handle all my DB access stuff....
I set up a connection instance variable to use when I need it. I will close it at the end of the app. Is this practice acceptable or should I be reconnecting each time?

Ideally, a model-view-control architecture is encouraged in web development. In implementing the MVC architecture, the best solution that I know as of the moment is to create a database handler object every time you connect to the database. This means that you have to close your database connection before returning your result set so you may want to use a cached row set. Why do we want to implement it that way? Because we don't want our view (.jsp file) to care about database access activities since we have our model (java bean) to do just that.
Oops, sorry my head was somewhere else. I thought you were doing a web application. =P
Message was edited by:
uncle_fester

Similar Messages

  • SSIS package Corrupted - Connection element is not found - Visual Studio 2008

    Some body help me...
    last week my senior give me a SSIS package, but when I open in visual studio 2008 there is pop up like this.
    TITLE: Microsoft Visual Studio
    There were errors while the package was being loaded.
    The package might be corrupted.
    See the Error List for details.
    BUTTONS:
    OK
    and this is the description of
    Error    1    Error loading KIBB_INVC_IS.02.dtsx: The connection "{A9C72380-F326-44BF-A7CB-B8C7E9103F01}" is not found. This error is thrown by Connections collection when the specific connection element is not found.
         C:\Users\CYH\Documents\Visual Studio 2008\Projects\IS\IS\KIBB_INVC_IS.02.dtsx    1    1    
    Error    10    Validation error. SheetValue Insertion Error Log Execute SQL Task: Connection manager "{A9C72380-F326-44BF-A7CB-B8C7E9103F01}" does not exist.      KIBB_INVC_IS.02.dtsx    0  
     0    
    Error    11    Validation error. SheetValue Insertion Error Log : There were errors during task validation.      KIBB_INVC_IS.02.dtsx    0    0    
    Error    12    Validation error. Data Flow Task: SCB_IB_IDS 05: The connection "{A9C72380-F326-44BF-A7CB-B8C7E9103F01}" is not found. This error is thrown by Connections collection when the specific connection element
    is not found.      KIBB_INVC_IS.02.dtsx    0    0    
    if some body know this problem, please help me to resolve my problem :(

    It is due to a connection manager being deleted.
    Oftentimes fixable by introducing it back. Sometimes the package even runs successfully even w/o it.
    But if you can create a new package anew.
    Arthur My Blog

  • Re-connecting Elements 9 to a New Location

    I have copied all my images - around 500Gb - to a new (larger) external Hard Drive.  The transfer took about 16 hours.
    Can anyone advise how I move/reconnect the Adobe Elements catalog to point to the new location?
    The answer I'd not like to hear is that I need to re-copy these source media files through instructions within Elements 9. I can't believe it's  above a smart software developer's ability or insight to predict that would be a common occurrence for Elements users and to have made it an easy process to ‘re-point’ their product to the new content location.
    Thanks
    Charles

    Charles,
    You had already made things clear in your other posts.
    As you say, you are starting with a very sophisticated tree organization, with deliberate file name duplications for instance, with a lot of external disks : I have never seen anything like this before... no I am wrong : its just a little more that what I did before starting to use Elements ten years ago
    Now its obvious to me that I have given you too much info, too many links and that has not helped you to understand how to solve your problems. Most of your objections in your last post show that you have missed the answers already given.
    Before applying the best methods to reconnect, there are facts you have to understand.
    - any database organizing system (DAM) like the Organizer, Lightroom or more sophisticated ones, provide ways to insure easy retrieval and grouping of media, sorting and rating, keeping track of originals and versions. That's also your goal.
    - you have created your own system (very similar to my own one, 10 years ago). The question is : do you consider it as the ultimate goal, or simply a means to achieve the above general goal ?
    - You want to keep your own organization : it's quite possible to do so even if it is redundant, and totally opposed to any database system philosophy. For instance, you understand that your Organizer catalog only contains paths to your selectec working files and totally ignores others. The builtin tools to move, rename, delete or backup/restore ignore other files. You don't want to use them precisely because you want to control all files. All those database systems can solve the final organization goals : they can deal with hundred of thousands pictures, keeping track of originals as well as version sets, they nearly completely free you of the task of thinking about folders. You simply have to use them, and trust them.
    - Do you really think that there is a market to develop such personal solutions ? As I said before it is possible to keep your organization together with the standard one, but that means only useless complexity. Even if the developers of Elements are not the smartest, they are working with the same choice as other elaborate systems like Lightroom : trust the software and understand and use it.
    - "Buyers beware..." There, you are right. There are other kinds of tools, and it should be obvious that many users cannot accept to trust a software and stop thinking about folders : they are right in thinking the Organizer is not the right tool for them.
    charlesjennings wrote:
    I CAN'T BELIEVE that the PSE developers didn't forsee the following needs:
    a. that users would want to move images from one disk to another at times as they ran out of space or upgraded
    b. that users may not want PSE to manage ALL their images, but just a sub-set (the better ones, 'working' files etc.)
    c. that Adobe hasn't produced either guidance or tools to make migration straightforward.
    - You are also partly right here : the Organizer was first introduced at a time when using external disks was not common. But you are wrong in that : the way to change disk or upgrade hardware or software version has been widely covered (see my links and Adobe's help) and there are safe ways included, especially the backup and restore way, the moving files way and ways of reconnecting (even if those are not as powerful as in Lightroom). Then managing only a subset of pictures has never been a problem, except if you insist on your sophisticated tree arborescence with duplicate names.
    Now, to solve your problem .:
    First did you read and can you follow the instructions in the 2nd link (quickly reconnecting...) I gave you ?
    There would be two other ways to do the job, but the fact that you have already reconnected some files might be a problem.
    - First : simply do the standard migrating way in the Organizer : backup your catalog to one of your external disks, and simply restore to the custom location keeping the same tree organization on your new drive. That's time consuming, but simple and safe and there is no risk for your original master files : the catalogued files will be restored in the right subfolders, totally ignoring duplicate file names.
    - The last resort... I won't give it here because it requires direct changes in the sqlite database contained in your catalog. I am sure that for one person that might help, I would cause severe troubles for dozens of others... I also think that if smart developers wanted to implement this catalog update following a drive change, they would meet many problems like yours because of seemingly identical situations hiding custom differences in personal organization.

  • What is the purpose of open/close connection data socket?

    Hello everyone,
    I am writing and reading values in OPC Server through data socket. What is the purpose of open/close connection data socket when writing /reading a value?  Without the open/close connection element, it still work correctly. I am writing values in the server thru event stucture.I do not need any buffered reading or writing. What will happen if I didnt not use the open/close connection? Maybe it may cause some problems in my program which i didnt realise? 
    And I have attached an example of my program. Thanks
    Yehchia
    Attachments:
    Test Event.vi ‏11 KB

    Hi YehChia,
    I was talking about something like that:
    1. Not good. since with every iteration the DS connection needs to be opened and closed.
    2. Good. Since you open the connection only once then do the reads and close it afterwords.
    Christian

  • Package connection error

    I created a project . the 4 packages uses same project connection to the ole db, and each has a package connection to the excel file it is supposed to import from c drive. the packages works well on the ssis platform and imports it into the engine, but when
    used in sql server agent service, it does not work and gives the error below. 
    Executed as user: USER-PC\SYSTEM. 
    Microsoft (R) SQL Server Execute Package Utility  
    Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.  
      Started:  11:50:16  Error: 2015-01-08 11:50:16.29     Code: 0xC001000E    
     Source: Package      Description: The connection "{D16EBEF0-87BB-4062-8512-0844538E99F5}" is not found.
     This error is thrown by Connections collection when the specific connection element is not found. 
     End Error  Error: 2015-01-08 11:50:16.34     Code: 0xC001000E     Source: Package     
     Description: The connection "{D16EBEF0-87BB-4062-8512-0844538E99F5}" is not found. 
    This error is thrown by Connections collection when the specific connection element is not found. 
     End Error  Error: 2015-01-08 11:50:16.34     Code: 0xC004800B     Source: Data Flow Task SSIS.Pipeline  
       Description: Cannot find the connection manager with ID "{D16EBEF0-87BB-4062-8512-0844538E99F5}" 
    in the connection manager collection due to error code 0xC0010009. That connection manager is needed by
     "OLE DB Destination.Connections[OleDbConnection]" 
    in the connection manager collection of "OLE DB Destination". Verify that a connection manager
     in the connection manager collection, Connections, has been created with that ID.
      End Error  Error: 2015-01-08 11:50:16.34     Code: 0xC0047017     
    Source: Data Flow Task SSIS.Pipeline     
    Description: OLE DB Destination failed validation and returned error code 0xC004800B. 
     End Error  Error: 2015-01-08 11:50:16.34     Code: 0xC004700C    
     Source: Data Flow Task SSIS.Pipeline    
     Description: One or more component failed validation.  
    End Error  Error: 2015-01-08 11:50:16.34     Code: 0xC0024107     Source: Data Flow Task     
     Description: There were errors during task validation.  
    End Error  DTExec: The package validation returned DTSER_FAILURE (1)
    i will appreciate your contributions. the project runtime is set to false as well. or do i have to do that for individual package

    Did you change the deployment type to package recently?
    +1
    Since you can see the errors in the job history, it means you scheduled the package like in the package deployment model, i.e. without using the catalog. Like this, you cannot use project connections.
    MCSE SQL Server 2012 - Please mark posts as answered where appropriate.

  • Running package programmactically from console causes error if package uses connection in Connection Manager.

    Hello my friends:
    I attempted to run a few packages programmatically using the code and solution on this page:
    http://msdn.microsoft.com/en-us/library/ms136090.aspx
    I observed that the script and process failed when I use the connection in SSIS/SSDT connection Manager in Visual Studio 2013. Meaning if I create a Connection for the Project in the Connection Manager and use it on tasks.
    However, the project and packages will run just fine if I simply add individual connection to each task where needed and do not use the Connection manager.
    If I use the Connection Manager, I get this error: This only happens when I run the package programmatically,
    if I run the package directly from Visual Studio, I get no errors.
    Error Message:
    Error in Microsoft.SqlServer.Dts.Runtime.Package/ : The connection "{0E6E938E-B0
    84-45E6-9110-0D532BD61787}" is not found. This error is thrown by Connections co
    llection when the specific connection element is not found.
    Error in Microsoft.SqlServer.Dts.Runtime.TaskHost/SSIS.Pipeline : Cannot find th
    e connection manager with ID "{0E6E938E-B084-45E6-9110-0D532BD61787}" in the con
    nection manager collection due to error code 0xC0010009. That connection manager
     is needed by "SQL Server Destination.Connections[OleDbConnection]" in the conne
    ction manager collection of "SQL Server Destination". Verify that a connection m
    anager in the connection manager collection, Connections, has been created with
    that ID.
    Error in Microsoft.SqlServer.Dts.Runtime.TaskHost/SSIS.Pipeline : SQL Server Des
    tination failed validation and returned error code 0xC004800B.
    Error in Microsoft.SqlServer.Dts.Runtime.TaskHost/SSIS.Pipeline : One or more co
    mponent failed validation.
    Error in Microsoft.SqlServer.Dts.Runtime.TaskHost/ : There were errors during ta
    sk validation.
    Connection Manager Screenshot:
    I am using that connection in an SQL Server Destination Task:
    And here is the code:
    class Program
    class MyEventListener : DefaultEvents
    public override bool OnError(DtsObject source, int errorCode, string subComponent,
    string description, string helpFile, int helpContext, string idofInterfaceWithError)
    Console.WriteLine("Error in {0}/{1} : {2}", source, subComponent, description);
    return false;
    static void Main(string[] args)
    string pkgLocation;
    Package pkg;
    Application app;
    DTSExecResult pkgResults;
    MyEventListener eventListener = new MyEventListener();
    pkgLocation =
    @"C:\Users\Administrator\Desktop\ExampleConnectionMgr\DataExtractionB.dtsx";
    app = new Application();
    pkg = app.LoadPackage(pkgLocation, eventListener);
    pkgResults = pkg.Execute(null, null, eventListener, null, null);
    Console.WriteLine(pkgResults.ToString());
    Console.ReadKey();
    Thank you everyone!

    I have confirmed that this problem, at least on the surface is caused by the lack of reference to the Connection in the Connection Manager as indicated by the error message.
    The solution here will require that the Connection is set directly within each task.
    If I simply set the connection in each task then the page runs just fine programmatically:
    I am also able to convert the Connection in the Connection Manager to Package Connection as shown in the screen shot below. This will override all references to the Connection Manager and make the connection local within each package or package
    task.
    Is there any other solution out there?
    Thanks again!
    Synth.
    This is exactly what I asked for in my previous post. Sorry if it wasnt clear.
    I guess the problem is in your case you're creating connection manager from VS which is not adding any reference of it to packages which is why its complaining of the missing connection reference
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page
    Hi my friend:
    Do you know how I can include the connection programmatically in code?
    I found this article but it is not very clear to me:
    I do not want to create a package in code, just the connection so that the program can run.
    Here is the article:
    http://msdn.microsoft.com/en-us/library/ms136093.aspx
    Thank you so much.
    Patrick

  • Start Element - Default Date - Error

    Hi,
    We have NW04s SP7 Portal and our VC version is
    VC Server Version is 645.7.1.0.
    1. In some scenarios we want some default list (data from SAP R/3) to be displayed by passing system date, i tried using NOW() option, it is not working.In our report we want to display the absentee list for system date, we have a form in which user can change the date and report is refreshed. Second part is working fine, when the user changes the date it display the correct data, default list for system date is not getting displayed.I have used START connect element to invoke the default action by setting the current date using NOW() but it is not working.Any ways to debug the same (i want to know what value is really passed to back end system).
    Please let me know your thoughts/solutions to the above mentioned issue.
    Thanks
    Senthil

    Hi Jarrod,
    NOW() command works fine when i use it for a field in a FORM, but if i use the NOW() option in Start Element it is not working.
    We ran the RFC, SQL trace in R/3, trace says that the X function module is called, but it does not show the values which are passed.
    Can you guide us on the debug part ? Any thing has to be done in R/3 like increasing the trace level etc.
    Thanks
    Senthil

  • Do I close my connection yet? How to improve it

    Hi all,
    my connection pool is not working well, the connection is not release back to pool. why??
    package formate;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import javax.sql.*;
    import pool.ConnectionPool;
    * TryJdbc.java
    * This servlet demonstrates using JDBC
    public class Formate extends HttpServlet {
       Statement stmt =null;
        ResultSet rs = null;
        Connection conn = null;
      ConnectionPool connectionPool = null;
    * Creates a connection pool.
    public void init() throws ServletException
    String jdbcDriver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
    String dbURL ="jdbc:microsoft:sqlserver://localhost:1433; DatabaseName=sequences";
    try
    //instantiate the connection pool object by passing the
    //jdbc driver, database URL, username, and password
    connectionPool = new ConnectionPool(jdbcDriver, dbURL,
    "A#$","RE@89");
    //specify the initial number of connections to establish
    connectionPool.setInitialConnections(5);
    //specify number of incremental connections to create if
    //pool is exhausted of available connections
    connectionPool.setIncrementalConnections(5);
    //specify absolute maximum number of connections to create
    connectionPool.setMaxConnections(20);
    connectionPool.createPool(); //create the connection pool
    catch(Exception e)
    System.out.println("Error: " + e);
    }in my doget I have
    conn = connectionPool.getConnection();
         stmt = conn.createStatement();
    ...query
    finally {
    try {
    if(rs != null)
    rs.close();
    rs = null;
    if(stmt != null)
    stmt .close();
    stmt = null;
    if(conn != null)
    conn.close();
    conn = null;
    connection.returnConnection(conn); }
    package pool;
    import java.sql.*;
    import java.util.*;
    public class ConnectionPool
    private String jdbcDriver = "";
    private String dbUrl = "";
    private String dbUsername = "";
    private String dbPassword = "";
    private int initialConnections = 10;
    private int incrementalConnections =5;
    private int maxConnections = 50;
    private Vector connections = null;
    * Constructor stores the parameters passed by the calling
    * object.
    * @param jdbcDriver String containing the fully qualified name
    * of the jdbc driver (class name and full package info)
    * @param dbUrl String containing the database URL
    * @param dbUsername String containing the username to use when
    * logging into the database
    * @param dbPassword String containing the password to use when
    * logging into the database
    public ConnectionPool(String jdbcDriver, String dbUrl,
    String dbUsername, String dbPassword)
    this.jdbcDriver = jdbcDriver;
    this.dbUrl = dbUrl;
    this.dbUsername = dbUsername;
    this.dbPassword = dbPassword;
    * Returns the initial number of connections to create.
          * @return Initial number of connections to create.
    public int getInitialConnections()
    return initialConnections;
          * Sets the initial number of connections to create.
    * @param initialConnections Initial number of connections to
    * create
    public void setInitialConnections(int initialConnections)
    this.initialConnections = initialConnections;
    * Returns the number of incremental connections to create if
    * the initial connections are all in use.
    * @return Number of incremental connections to create.
    public int getIncrementalConnections()
    return incrementalConnections;
    * Sets the number of incremental connections to create if
    * the initial connections are all in use.
    *@param incrementalConnections Number of incremental
    * connections to create.
    public void setIncrementalConnections(
    int incrementalConnections)
    this.incrementalConnections = incrementalConnections;
    * Returns the absolute maximum number of connections to
          * create. If all connections are in use, the getConnection()
    * method will block until one becomes free.
    * @return Maximum number of connections to create.
    public int getMaxConnections()
    return maxConnections;
    * Sets the absolute maximum number of connections to create.
    * If all connections are in use, the getConnection() method
    * will block until one becomes free.
    * @param maxConnections Maximum number of connections to
    * create.
    public void setMaxConnections(int maxConnections)
    this.maxConnections = maxConnections;
    * Creates a pool of connections. Number of connections is
    * determined by the value of the initialConnections property.
    public synchronized void createPool() throws Exception
    //make sure that createPool hasn't already been called
    if (connections!=null)
    return; //the pool has already been created, return
    //instantiate JDBC driver object from init param jdbcDriver
    Driver driver = (Driver)
    (Class.forName(jdbcDriver).newInstance());
    DriverManager.registerDriver(driver); //register JDBC driver
    connections = new Vector();
    //creates the proper number of initial connections
    createConnections(initialConnections);
    * Creates the specified number of connections, places them in
    * a PooledConnection object, and adds the PooledConnection to
    * the connections vector.
    * @param numConnections Number of connections to create.
    private void createConnections(int numConnections) throws
    SQLException
    //create the specified number of connections
    for (int x=0; x < numConnections; x++)
    //have the maximum number of connections been created?
    //a maxConnections value of zero indicates no limit
    if (maxConnections > 0 &&
    connections.size() >= maxConnections)
    break; //break out of loop because we're at the maximum
    //add a new PooledConnection object to connections vector
    connections.addElement(new PooledConnection(
    newConnection()));
    System.out.println("Database connection created...");
    * Creates a new database connection and returns it.
    * @return New database connection.
    private Connection newConnection() throws SQLException
    //create a new database connection
    Connection conn = DriverManager.getConnection (dbUrl,
    dbUsername, dbPassword);
    //if this is the first connection, check the maximum number
    //of connections supported by this database/driver
    if (connections.size()== 0)
    DatabaseMetaData metaData = conn.getMetaData();
    int driverMaxConnections = metaData.getMaxConnections();
    //driverMaxConnections value of zero indicates no maximum
    //or unknown maximum
    if (driverMaxConnections > 0 &&
    maxConnections > driverMaxConnections)
    maxConnections = driverMaxConnections;
    return conn; //return the new connection
    * Attempts to retrieve a connection from the connections
    * vector by calling getFreeConnection(). If no connection is
    * currently free, and more can not be created, getConnection()
    * waits for a short amount of time and tries again.
    * @return Connection object
    public synchronized Connection getConnection()throws
    SQLException
    //make sure that createPool has been called
    if (connections == null)
    return null; //the pool has not been created
    Connection conn = getFreeConnection();//get free connection
    while (conn == null) //no connection was currently free
    //sleep for a quarter of a second and then check to see if
    //a connection is free
    wait(250);
    conn = getFreeConnection(); //try again to get connection
    return conn;
    * Returns a free connection from the connections vector. If no
    * connection is available, a new batch of connections is
    * created according to the value of the incrementalConnections
    * variable. If all connections are still busy after creating
    * incremental connections, the method will return null.
    * @return Database connection object
    private Connection getFreeConnection() throws SQLException
    //look for a free connection in the pool
    Connection conn = findFreeConnection();
    if (conn == null)
    //no connection is free, create additional connections
    createConnections(incrementalConnections);
    //try again to find a free connection
    conn = findFreeConnection();
    if (conn == null)
    //there are still no free connections, return null
    return null;
    return conn;
    * Searches through all of the pooled connections looking for
    * a free connection. If a free connection is found, its
    * integrity is verified and it is returned. If no free
    * connection is found, null is returned.
    * @return Database connection object.
    private Connection findFreeConnection()throws SQLException
    Connection conn = null;
    PooledConnection pConn = null;
    Enumeration enum = connections.elements();
    //iterate through the pooled connections looking for free one
    while (enum.hasMoreElements())
    pConn =(PooledConnection)enum.nextElement();
    if (!pConn.isBusy())
    //this connection is not busy, get a handle to it
    conn = pConn.getConnection();
    pConn.setBusy(true); //set connection to busy
    //connection is no longer valid, create a new one
    conn = newConnection();
    //replace invalid connection with new connection
    pConn.setConnection(conn);
    break; //we found a free connection, stop looping
    return conn;
    * Test the connection to make sure it is still valid. If not,
    * close it and return FALSE.
    * @param conn Database connection object to test.
    * @return True indicates connection object is valid.
    * Turns off the busy flag for the current pooled connection.
    * All ConnectionPool clients should call returnConnection() as
    * soon as possible following any database activity (within a
    * finally block).
    * @param conn Connection object
    public void returnConnection(Connection conn)
    //make sure that createPool has been called
    if (connections== null)
    return; //the pool has not been created
    PooledConnection pConn = null;
    Enumeration enum = connections.elements();
    //iterate through the pooled connections looking for the
    //returned connection
    while (enum.hasMoreElements())
    pConn =(PooledConnection)enum.nextElement();
    //determine if this pooled connection contains the returned
    //connection
    if (conn == pConn.getConnection())
    //the connection has been returned, turn off busy flag
    pConn.setBusy(false);
    break;
    * Refreshes all of the connections in the connection pool.
    public synchronized void refreshConnections()throws
    SQLException
    //make sure that createPool has been called
    if (connections == null)
    return; //the pool has not been created
    PooledConnection pConn = null;
    Enumeration enum = connections.elements();
    while (enum.hasMoreElements())
    pConn =(PooledConnection)enum.nextElement();
    if (!pConn.isBusy())
    wait(10000); //wait 5 seconds
    closeConnection(pConn.getConnection());
              pConn.setConnection(newConnection());
              pConn.setBusy(false);
    * Closes all of the connections and empties the connection
    * pool. Once this method has been called, the createPool()
    * method can again be called.
    public synchronized void closeConnections() throws SQLException
    //make sure that createPool has been called
    if (connections == null)
    return; //the pool has not been created
    PooledConnection pConn = null;
    Enumeration enum = connections.elements();
    while (enum.hasMoreElements())
    pConn = (PooledConnection)enum.nextElement();
    if (!pConn.isBusy())
    wait(5000); //wait 5 seconds
    closeConnection(pConn.getConnection());
    connections.removeElement(pConn);
    connections = null;
    * Closes a database connection.
    * @param conn Database connection to close.
    private void closeConnection(Connection conn)
    try
    conn.close();
    catch (SQLException e)
    * Sleeps for a specified number of milliseconds.
    *@param mSeconds Number of seconds to sleep.
    private void wait(int mSeconds)
    try
    Thread.sleep(mSeconds);
    catch (InterruptedException e)
    * Inner class encapsulating the properties of a pooled
    * connection object. These properties include a JDBC database
    * connection object and a flag indicating whether or not the
    * database object is currently in use (busy).
    class PooledConnection
    Connection connection = null;
    boolean busy = false;
    public PooledConnection(Connection connection)
    this.connection = connection;
    public Connection getConnection()
    return connection;
    public void setConnection(Connection connection)
    this.connection = connection;
    public boolean isBusy()
    return busy;
    public void setBusy(boolean busy)
    this.busy = busy;
    }thank you

    If you are using connection pooling then those places in your code where you used to close a connection need to be replaced by code that returns the connection to the pool.
    It's the job of the pool implementation to decide whether or not connections need closing (or opening), depending on the rules you set up for the pooler.

  • TimeOut error while running a report on the report server

    Hi,
    One of my report is taking 30 minutes to generate the output. It works fine when I run it locally, but when I run it on report server I encounter the following error message. Its a timeout error. Any solution other than tuning the query, please.
    500 Internal Server Error
    org.omg.CORBA.OBJECT_NOT_EXIST: minor code: 0 completed: No
         at java.lang.Class.newInstance0(Native Method)
         at java.lang.Class.newInstance(Class.java:237)
         at com.inprise.vbroker.orb.SE.read(SE.java:28)
         at com.inprise.vbroker.orb.DelegateImpl.handleReply(DelegateImpl.java:711)
         at com.inprise.vbroker.orb.DelegateImpl.invoke(DelegateImpl.java:606)
         at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:459)
         at oracle.reports.server._ConnectionStub.getMainFile(_ConnectionStub.java:1283)
         at oracle.reports.client.ReportRunner.getMainFile(ReportRunner.java:488)
         at oracle.reports.rwclient.RWReportRunner.getMainFile(RWReportRunner.java:121)
         at oracle.reports.rwclient.RWReportRunner.getMainFile(RWReportRunner.java:95)
         at oracle.reports.rwclient.RWClient.runReport(RWClient.java:1322)
         at oracle.reports.rwclient.RWClient.processRequest(RWClient.java:1139)
         at oracle.reports.rwclient.RWClient.doPost(RWClient.java:328)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:283)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
         at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:59)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
         at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:523)
         at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
         at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
         at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.AJPRequestHandler.run(AJPRequestHandler.java:151)
         at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:64)

    Hi Bhasker
    Try setting idleTimeOut under connection element in server configuration file to a large value.
    Regards
    Sripathy

  • Problem with setting oracle type parameter in viewobject query

    Hi There,
    I am facing a problem with JDev1013. I have a view that has JDBC positional parameters that are supposed to be in parameters for function like:
    SELECT x.day, x.special_exact_period_only
    FROM (
      SELECT x.day, x.special_exact_period_only
      FROM (
        SELECT
          x.day,
          rb.special_exact_period_only
      FROM TABLE (
        RentabilityPkg.findMarkerSlots(
          'start',
          ? /* dchannel */,
          NULL,
          ? /* resorts */,
          'special',
          NULL,
          ? /* code */,
          NULL,
          TRUNC(SYSDATE),
          TRUNC(SYSDATE + 365 * 2),
          NULL
      ) x
        JOIN resourcebase rb USING (rentabilitymanager_id)
        UNION
        SELECT
          x.day,
          rb.special_exact_period_only
        FROM TABLE (
          RentabilityPkg.findMarkerSlots(
            'start',
            ? /* dchannel */,
            NULL,
            ? /* resorts */,
            'composition',
            NULL,
            ? /* code */,
            NULL,
            TRUNC(SYSDATE),
            TRUNC(SYSDATE + 365 * 2),
            NULL
        ) x
        JOIN resourcebase rb USING (rentabilitymanager_id)
      )x
      ORDER BY x.day
    ) x
    WHERE ROWNUM <= 30now the JDBC positional parameters take our custom defined list type defined as:
    CREATE TYPE NumberList AS TABLE OF NUMBER;
    we are setting the parameter in the views with the help of oracle.sql.ARRAY class like:
       * Set parameters.
      public void setParams(Integer dchannelId, Integer[] resorts, String specialCode)
        try {
              System.out.println(this.getClass() + ".setParams()");
              ARRAY arrParam1 = ((NWSApplicationModule)getApplicationModule()).toSQLNumberList(Arrays.asList(resorts));
              ARRAY arrParam2 = ((NWSApplicationModule)getApplicationModule()).toSQLNumberList(Arrays.asList(resorts));
              System.out.println("arrParam1 - " + arrParam1);
              System.out.println("arrParam1 - " + arrParam1);
              System.out.println(this.getClass() + " ARRAY - " + arrParam1.getArray());
              System.out.println(this.getClass() + " -- " + arrParam1.length());
              System.out.println("arrParam2 - " + arrParam2);
              System.out.println("arrParam2 - " + arrParam2);
              System.out.println(this.getClass() + " ARRAY - " + arrParam2.getArray());
              System.out.println(this.getClass() + " -- " + arrParam2.length());
              Object[] params =
                   { dchannelId,
                        arrParam1,
                        specialCode,
                        dchannelId,
                        arrParam2,
                        specialCode
              setWhereClauseParams(params);
              System.out.println("DONE WITH " + this.getClass() + ".setParams()");
        catch(Exception ex)
              ex.printStackTrace(System.out);
      }the toSQLNumberList() method is defined in our App module baseclass as follows:
      public ARRAY toSQLNumberList(Collection coll)
           debug("toSQLNumberList()");
           DBTransaction txn = (DBTransaction)getTransaction();
           debug("txn - " + txn + " : " + txn.getClass());
           return NWSUtil.toSQLNumberList(coll, getConnection(txn));
      public static ARRAY toSQLNumberList(Collection c, Connection connection)
        //printTrace();
        debug("toSQLNumberList()");
        try
          ArrayDescriptor numberList = ArrayDescriptor.createDescriptor("NUMBERLIST", connection);
          NUMBER[] elements = new NUMBER[c == null ? 0 : c.size()];
          if (elements.length > 0 )
            Iterator iter = c.iterator();
            for (int i = 0; iter.hasNext(); i++)
              elements[i] = new NUMBER(iter.next().toString());
          return new ARRAY(numberList, connection, elements);
        catch (Exception ex)
          ex.printStackTrace();
          return null;
      protected Connection getConnection(DBTransaction dbTransaction)
        //return null;
        debug("Inside getConnection()");
        CallableStatement s = null;
        try
           * Getting Conenction in BC4J is dirty but its better
           * as otherwise we might end up coding with connections
           * and the Transaction Integrety will be
          s = dbTransaction.createCallableStatement("BEGIN NULL; END;", 0);
          debug("DOING s.getConnection()...");
          Connection conn = s.getConnection();
          debug("DONE WITH  s.getConnection()...");
          /*try
                throw new Exception("TEST");
           catch (Exception ex)
                ex.printStackTrace(System.out);
          debug("conn CLASS - " + conn.getClass());
          return conn;
        catch (Exception ex)
          ex.printStackTrace();
          return null;
        finally
          try { s.close(); }
          catch (Exception ex) {}
      }Whenever we try setting the parameters in view using setParams() and use this view to set the model of a java control it thorws the following exception :
    [2006-10-10 12:34:48,797 AWT-EventQueue-0 ERROR] JBO-28302: Piggyback write error
    oracle.jbo.PiggybackException: JBO-28302: Piggyback write error
         at oracle.jbo.common.PiggybackOutput.getPiggybackStream(PiggybackOutput.java:185)
         at oracle.jbo.common.JboServiceMessage.marshalRefs(JboServiceMessage.java:267)
         at oracle.jbo.server.remote.PiggybackManager.marshalServiceMessage(PiggybackManager.java:343)
         at oracle.jbo.server.remote.PiggybackManager.marshalServiceMessage(PiggybackManager.java:316)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2283)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteAMReservation_StatefulSessionBeanWrapper906.doMessage(RemoteAMReservation_StatefulSessionBeanWrapper906.java:286)
         at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
         at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
         at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
         at oracle.jbo.common.SvcMsgResponseValues.writeObject(SvcMsgResponseValues.java:116)
         at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
         at oracle.jbo.common.PiggybackOutput.getPiggybackStream(PiggybackOutput.java:173)
         at oracle.jbo.common.JboServiceMessage.marshalRefs(JboServiceMessage.java:267)
         at oracle.jbo.server.remote.PiggybackManager.marshalServiceMessage(PiggybackManager.java:343)
         at oracle.jbo.server.remote.PiggybackManager.marshalServiceMessage(PiggybackManager.java:316)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2283)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteAMReservation_StatefulSessionBeanWrapper906.doMessage(RemoteAMReservation_StatefulSessionBeanWrapper906.java:286)
         at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)This is a typical interaction between 2 server-side components (view-object and app module). Now the question is why is this exception thrown? Any answers?
    This application is one that we have migrated from 904 to 1013 and are trying to get it running in 3-tier.
    Regards,
    Anupam

    Sorry I missed out some semicolons, the script follws:
    -- The following TABLE was created to simulate the issue
    CREATE TABLE TEST_OBJECT
         ASSET_ID NUMBER,
         OBJECT_ID NUMBER,
         NAME VARCHAR2(50)
    INSERT INTO TEST_OBJECT VALUES(1,1,'AAA');
    INSERT INTO TEST_OBJECT VALUES(2,2,'BBB');
    INSERT INTO TEST_OBJECT VALUES(3,3,'CCC');
    COMMIT;
    SELECT * FROM TEST_OBJECT;
    -- The following TYPES was created to simulate the issue
    CREATE OR REPLACE
    TYPE DUTYRESULTOBJECTTAB AS TABLE OF DUTYRESULTOBJECT;
    CREATE OR REPLACE
    type DutyResultObject as object
    ( ASSET_ID number,
      OBJECT_ID number,
      NAME varchar2(150)
    -- The following PACKAGE N FUNCTION was created to simulate the issue
    CREATE OR REPLACE PACKAGE TESTOBJECTPKG
    IS
         FUNCTION OBJECTSEARCH(P_RESOURCE IN NUMBERLIST) RETURN DUTYRESULTOBJECTTAB;
    END;
    CREATE OR REPLACE PACKAGE BODY TESTOBJECTPKG
    IS
         FUNCTION OBJECTSEARCH(P_RESOURCE IN NUMBERLIST) RETURN DUTYRESULTOBJECTTAB
         IS
           BULKDUTYRESULTOBJECTTAB DUTYRESULTOBJECTTAB;
         BEGIN
           SELECT DUTYRESULTOBJECT(ASSET_ID, OBJECT_ID, NAME)
           BULK COLLECT INTO BULKDUTYRESULTOBJECTTAB
           FROM TEST_OBJECT;
           RETURN BULKDUTYRESULTOBJECTTAB;
         END;
    END;
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need help w corba/jdbc class

    hi
    i'm trying to get this class to work right, i don't think i'm coding it the right way, especially the getAllAccounts() and selectAccounts() methods. this code compiles cleanly, but i get runtime exceptions when i try to run my app. my runtime exceptions look like
    ############################ StackTrace ############################
    java.lang.NullPointerException
    at com.kafein.accountServices.AccountServiceImpl.getAllAccounts(AccountS
    erviceImpl.java:218)
    at com.kafein.idl.accountServices.AccountServicePOA._invoke(AccountServi
    cePOA.java:74)
    at org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java
    :247)
    at org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:477)
    at org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:604)
    and
    Creating 100 Accounts
    org.omg.CORBA.UNKNOWN: This exception was reported by the server, it is only re-
    thrown here. vmcid: 0x0 minor code: 0 completed: No
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.jacorb.orb.SystemExceptionHelper.read(SystemExceptionHelper.java:
    157)
    at org.jacorb.orb.connection.ReplyInputStream.checkExceptions(ReplyInput
    Stream.java:117)
    at org.jacorb.orb.Delegate.invoke(Delegate.java:942)
    at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
    at com.kafein.idl.accountServices._AccountServiceStub.getAllAccounts(_Ac
    countServiceStub.java:134)
    at com.kafein.client.AccountClient.main(AccountClient.java:111)
    org.omg.CORBA.UNKNOWN: This exception was reported by the server, it is only re-
    thrown here. vmcid: 0x0 minor code: 0 completed: No
    ORB shutting down...
    code for this class is below...
    // AccountServiceImpl.java: The AccountService Implementation
    package com.kafein.accountServices;
    import java.util.Hashtable;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    import junit.framework.TestCase;
    import junit.framework.Test;
    import junit.framework.TestSuite;
    import org.omg.PortableServer.*;
    import com.kafein.idl.accountServices.AccountServicePOA;
    import com.kafein.idl.accountServices.AccountEntryStruct;
    import com.kafein.idl.accountServices.AccountStruct;
    import com.kafein.idl.utilities.DateTimeStruct;
    import com.kafein.idl.exceptions.NotFoundException;
    import com.kafein.idl.exceptions.DataValidationException;
    import com.kafein.idl.errorCodes.DataValidationErrorCodes;
    import com.kafein.utils.ServiceHandler;
    import com.kafein.utils.Log;
    import java.net.URL;
    import java.sql.*;
    import java.util.*;
    * AccountServiceImpl is an implementation of the
    * idl.accountServices.AccountService interface.
    public class AccountServiceImpl extends AccountServicePOA {
      POA poa;
      private Hashtable accounts = new Hashtable(); // collection of Accounts
      private static int nextAccountID = 1; // global account ID
      Connection connection;
      Vector connections;
      Statement statement;
      PreparedStatement preparedStatement;
       * Construct an instance.
      public AccountServiceImpl(POA aPOA, String driver, String url, String user, String password) {
        super();
        poa = aPOA;
        driver = driver;
        url = url;
        user = user;
        password = password;
        connections = new Vector();
        // Connect to Database
        try {
            connect(driver,url,user,password);
        catch(Exception e) {
               e.printStackTrace();       
        // Simple Database Select
        try {
            testSimpleSelect();
        catch(Exception e) {
               e.printStackTrace();       
        // Database Select
        try {
            testSelect();
        catch(Exception e) {
               e.printStackTrace();       
       * Overloaded constructor for unit tests.
      protected AccountServiceImpl() {
        poa = null;
       * createAccount is used by administrator to add a new Account
       * in the system.
       * @param newAccount AccountEntryStruct containing data for new account
       * @return int the new unique Account ID
       * @exception com.kafein.idl.exceptions.DataValidationException
      public int createAccount(AccountEntryStruct newAccount) throws
        DataValidationException {
        validateData (newAccount); // throws DataValidationException;
        int accountID = getNextID();     
        // Create new Account.
        Account anAccount = new Account(accountID,
                            newAccount.userName,
                            newAccount.userEmail,
                            newAccount.creditCardType,
                            newAccount.creditCardNumber,
                            newAccount.creditCardExpirationDate.year,
                            newAccount.creditCardExpirationDate.month,
                            newAccount.userPassword,
                            newAccount.initialBalance);
    // Insert here / call method insertAccount() pass it in an account object
    // or call manager object - accountmanager.put()
        // Insert Account into Database
        try {
            insertAccount(anAccount);
        catch(Exception e) {
               e.printStackTrace();       
        accounts.put(accountID,anAccount);
        return accountID;
       * isAccountValid is used to validate a user logon.
       * @param accountID AccountID
       * @param userPassword String
       * @return boolean true to indicate an existing Account
      public boolean isValidAccount (int accountID, String userPassword) {
        // Get account with key equal to accountID.
        AccountStruct anAccount;
        try {
          anAccount = (AccountStruct) getAccount (accountID);
        catch (NotFoundException e) {
          return false;
        // Verify password.
        return (anAccount.userPassword.equals(userPassword) ? true : false);
       * getAccount is used to retrieve an existing Account in the system
       * @param int AccountID
       * @return AccountStruct containing data for the existing Account
       * @exception com.kafein.idl.exceptions.NotFoundException
      public AccountStruct getAccount(int accountID)throws
        NotFoundException {
        // Verify that accountID is within an appropriate interval.
        if (accountID < 1 || accountID > accounts.size()) {
          throw new NotFoundException(DataValidationErrorCodes.INVALID_ACCOUNT_ID,
                          "Account ID not found");
        // Get Account and convert to AccountStruct (which is returned).
        Account anAccount = (Account) accounts.get(accountID);
        return anAccount.getAccountStruct();
       * getAllAccounts is used to retrieve all existing Accounts in the system
       * @return AccountStruct[] containing all existing Accounts.
       * @fyi returns an empty sequence if no Accounts exist
      // GetAllAcounts method v. 2 - rather than enumerating through the vector
      // call a method that returns a collection of objs in that method where
      // you do select stmts
      public AccountStruct[] getAllAccounts() {
        // Allocate the array of AccountStructs.
        Vector results = new Vector();
        try {
                results = selectAccounts();
        catch(Exception e) {
               e.printStackTrace();       
        //Vector results = selectAccounts();
        int lastKey = results.size();
        //int lastKey = accounts.size();
        AccountStruct[] accountSequence = new AccountStruct[lastKey];
        if (lastKey==0) {
          return accountSequence;
        // Create AccountStructs from Accounts.
        for (int i = 1; i <= lastKey; i++) {
          Account anAccount = (Account) accounts.get(i);
          accountSequence[i-1] = anAccount.getAccountStruct();
        return accountSequence;
       * validateData is used to check new account data.
       * @param newAccount AccountEntryStruct containing data for new account
       * @exception com.kafein.idl.exceptions.DataValidationException
      protected void validateData(AccountEntryStruct newAccount) throws
        DataValidationException {
        // Check all of the member data in newAccount.
        if (newAccount.userName.equals("")) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_USER_NAME,
              "User Name must not be empty");
        if (newAccount.userEmail.equals("")) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_USER_EMAIL,
              "User Email must not be empty");
        if (newAccount.creditCardType.equals("")) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_CREDIT_CARD_TYPE,
              "Credit card type must not be empty");
        if (newAccount.creditCardNumber.equals("")) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_CREDIT_CARD_NUMBER,
              "Credit card number must not be empty");
        // Compare creditCardExpirationDate to current date
        // (we only consider year and month).
        GregorianCalendar now = new GregorianCalendar();
        DateTimeStruct proposed = newAccount.creditCardExpirationDate;
        if (proposed.year < now.get (Calendar.YEAR) ||
         (proposed.year == now.get (Calendar.YEAR) &&
          proposed.month < now.get (Calendar.MONTH) + 1)) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_CREDIT_CARD_EXPIRATION_DATE,
              "Credit card has expired");
        if (newAccount.userPassword.equals("")) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_USER_PASSWORD,
              "Password must not be empty");
        else if (!newAccount.userPassword.equals(newAccount.userPasswordVerification)) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_USER_PASSWORD,
              "Password verification failure");
        if (newAccount.initialBalance < 0.0F) {
          throw new DataValidationException(
              DataValidationErrorCodes.INVALID_BALANCE,
              "Account Balance cannot have a negative balance");
       * getNextID is used to generate a unique ID.
       * Needs a much better implementation that generates a globally unique ID!
       * @return int an Account ID
      protected synchronized int getNextID() {
        nextAccountID++;
        return nextAccountID - 1;
       * override _default_POA to return this servant's POA, not Root POA
      public POA _default_POA() {
        return poa;
       * jdbc related methods
      public void connect(String driver, String url, String user, String password)
                    throws Exception {
            try {
                // Load JDBC driver
                Class.forName(driver);
                System.out.println("Connecting to " + url);
                connection = DriverManager.getConnection(url, user, password);
                connections.add(connection);
                connection.setAutoCommit(false);
            } catch(Exception e) {
                System.err.println("System Exception in connect");
                System.err.println(e);
                throw e;
      public void closeConnection() throws Exception {
            try {
                Enumeration myEnum = connections.elements();
                while ( myEnum.hasMoreElements() ) {
                    System.out.println("Closing connection");
                    ((Connection) myEnum.nextElement()).close();
            } catch (Exception e) {
                System.err.println("System Exception in closeConnection");
                System.err.println(e);
                throw e;
      private void testSimpleSelect() throws Exception {
            try {
                Statement statement = connection.createStatement();
                ResultSet rs = statement.executeQuery("Select 1 from ACCOUNT");
                if (rs != null && rs.next()) {
                   int value = rs.getInt(1);
                   System.out.println("Fetched value " + value);
                connection.commit();
                statement.close();
            } catch(Exception e) {
                System.err.println("System Exception in testSimpleSelect");
                System.err.println(e);
                throw e;
      private void testSelect() throws Exception {
            try {
                Statement statement = connection.createStatement();
                ResultSet rs = statement.executeQuery(
                    "Select ACCT_ID, ACCT_USERNAME, ACCT_USEREMAIL, ACCT_CC_TYPE, ACCT_CC_NUMBER, ACCT_CC_EXPYR, ACCT_CC_EXPMO, ACCT_USERPASSWORD, ACCT_USERBALANCE from ACCOUNT LIMIT 1");
                System.out.println("Account ID   User Name     User Email     CC Type     CC Number     CC Expyr CC Expmo User Password     User Balance");
                while (rs != null && rs.next()) {
                    int acct_id = rs.getInt(1);
                    String acct_username = rs.getString(2);
                    String acct_useremail = rs.getString(3);
                    String acct_cc_type = rs.getString(4);
                    String acct_cc_number = rs.getString(5);
                    int acct_cc_expyr = rs.getInt(6);
                    int acct_cc_expmo = rs.getInt(7);
                    String acct_userpassword = rs.getString(8);
                    float acct_userbalance = rs.getFloat(9);
                    System.out.println(acct_id + "         " +
                                       acct_username + "   " +
                                       acct_useremail + "   " +
                                       acct_cc_type + "   " +
                                       acct_cc_number + "   " +
                                       acct_cc_expyr + "   " +
                                       acct_cc_expmo + "   " +
                                       acct_userpassword + "   " +
                                       acct_userbalance);
                connection.commit();
                statement.close();
            } catch(Exception e) {
                System.err.println("System Exception in testSelect");
                System.err.println(e);
                throw e;
      private void testLoadData() throws Exception {
            int numberOfAccounts = 5;
            String  acct_username    = "<--20 BYTE STRING-->";
            String  acct_useremail = "<--20 BYTE STRING-->";
         String  acct_cc_type = "TEST ";
            String  acct_cc_number = "<--20 BYTE STRING-->";
            int  acct_cc_expyr = 2000;
            int  acct_cc_expmo = 1;
            String  acct_userpassword = "<--20 BYTE STRING-->";
            float     acct_userbalance = 0.0F;
            int     acct_id = 0;
         try {
                System.out.println("Inserting data...");
                connection.setAutoCommit(false);
                // Calculate Start time
                System.out.println("Starting data insertion (" + numberOfAccounts +
                    " rows) into ACCOUNT table..");
                long startTime = System.currentTimeMillis();
                preparedStatement = connection.prepareStatement(
                    "INSERT INTO ACCOUNT (ACCT_ID, ACCT_USERNAME, ACCT_USEREMAIL, ACCT_CC_TYPE, ACCT_CC_NUMBER, " +
                    "ACCT_CC_EXPYR, ACCT_CC_EXPMO, ACCT_USERPASSWORD, ACCT_USERBALANCE) VALUES ( ?, ?, ?, ?, ?, ? , ?, ?, ?)");
                // Insert accounts in ACCOUNT table
                for (int i = 1; i <= numberOfAccounts; i++) {
                    acct_id  = i * 1000;
                    preparedStatement.setInt(1, acct_id);
                    preparedStatement.setString(2, acct_username);
                    preparedStatement.setString(3, acct_useremail);
                    preparedStatement.setString(4, acct_cc_type);
                    preparedStatement.setString(5, acct_cc_number);
                    preparedStatement.setInt(6, acct_cc_expyr);
                    preparedStatement.setInt(7, acct_cc_expmo);
                    preparedStatement.setString(8, acct_userpassword);
                    preparedStatement.setFloat(9, acct_userbalance);
              preparedStatement.executeUpdate();
                    connection.commit();
                System.out.println(numberOfAccounts + " accounts created.");
                preparedStatement.close();
                long stopTime = System.currentTimeMillis();
                System.out.println("Account table load complete.");
                System.out.println("Load time = " +
                                   ((stopTime - startTime)/(1000f)) + " seconds");
                System.out.println("Data insertion complete");
            } catch(Exception e) {
                System.err.println("System Exception in loadData");
                System.err.println(e);
                throw e;
       * insertAccount is used to insert a new Account in the Database
       * @param int AccountID
       * @return AccountStruct containing data for the existing Account
      private void insertAccount(Account anAccount) throws Exception {
              AccountStruct anAccountStruct = anAccount.getAccountStruct();  
         int numberOfAccounts = 1;
         String  acct_username    = anAccountStruct.userName;
            String  acct_useremail = anAccountStruct.userEmail;
         String  acct_cc_type = anAccountStruct.creditCardType;
            String  acct_cc_number = anAccountStruct.creditCardNumber;
         int acct_cc_expyr = anAccountStruct.creditCardExpirationDate.year;
            int acct_cc_expmo = anAccountStruct.creditCardExpirationDate.month;
            String  acct_userpassword = anAccountStruct.userPassword;
            float     acct_userbalance = anAccountStruct.accountBalance;
            int     acct_id = anAccountStruct.accountID;
         try {
                System.out.println("Inserting data...");
                connection.setAutoCommit(false);
    //instead of system.out just log
                // Calculate Start time
                System.out.println("Starting data insertion ( 1" +
                    " row) into ACCOUNT table..");
                long startTime = System.currentTimeMillis();
                preparedStatement = connection.prepareStatement(
                    "INSERT INTO ACCOUNT (ACCT_ID, ACCT_USERNAME, ACCT_USEREMAIL, ACCT_CC_TYPE, ACCT_CC_NUMBER, " +
                    "ACCT_CC_EXPYR, ACCT_CC_EXPMO, ACCT_USERPASSWORD, ACCT_USERBALANCE) VALUES ( ?, ?, ?, ?, ?, ? , ?, ?, ?)");
                    acct_id  = 1000;
                    preparedStatement.setInt(1, acct_id);
                    preparedStatement.setString(2, acct_username);
                    preparedStatement.setString(3, acct_useremail);
                    preparedStatement.setString(4, acct_cc_type);
                    preparedStatement.setString(5, acct_cc_number);
                    preparedStatement.setInt(6, acct_cc_expyr);
                    preparedStatement.setInt(7, acct_cc_expmo);
                    preparedStatement.setString(8, acct_userpassword);
                    preparedStatement.setFloat(9, acct_userbalance);
              preparedStatement.executeUpdate();
                    connection.commit();
                System.out.println("1 account created.");
                preparedStatement.close();
                long stopTime = System.currentTimeMillis();
                System.out.println("Account table load complete.");
                System.out.println("Load time = " +
                                   ((stopTime - startTime)/(1000f)) + " seconds");
                System.out.println("Data insertion complete");
            } catch(Exception e) {
                System.err.println("System Exception in loadData");
                System.err.println(e);
                throw e;
      private Vector selectAccounts() throws Exception {
            try {
                // Create Vector to hold individual Account values
             Vector mainvector = new Vector();
             Vector values = new Vector();
             Statement statement = connection.createStatement();
                ResultSet rs = statement.executeQuery(
                    "Select ACCT_ID, ACCT_USERNAME, ACCT_USEREMAIL, ACCT_CC_TYPE, ACCT_CC_NUMBER, ACCT_CC_EXPYR, ACCT_CC_EXPMO, ACCT_USERPASSWORD, ACCT_USERBALANCE from ACCOUNT");
                System.out.println("Account ID   User Name     User Email     CC Type     CC Number     CC Expyr CC Expmo User Password     User Balance");
             // Iterate through result set
             while (rs != null && rs.next()) {
              // Make sure values is empty
              values.clear();
              int acct_id = rs.getInt(1);
                    String acct_username = rs.getString(2);
                    String acct_useremail = rs.getString(3);
                    String acct_cc_type = rs.getString(4);
                    String acct_cc_number = rs.getString(5);
                    int acct_cc_expyr = rs.getInt(6);
                    int acct_cc_expmo = rs.getInt(7);
                    String acct_userpassword = rs.getString(8);
                    float acct_userbalance = rs.getFloat(9);
              // Populate Vector values
              values.addElement(rs.getObject(1));
              values.addElement(rs.getObject(2));
              values.addElement(rs.getObject(3));
              values.addElement(rs.getObject(4));
              values.addElement(rs.getObject(5));
              values.addElement(rs.getObject(6));
              values.addElement(rs.getObject(7));
              values.addElement(rs.getObject(8));
              values.addElement(rs.getObject(9));
              mainvector.addElement(values);
                    System.out.println(acct_id + "         " +
                                       acct_username + "   " +
                                       acct_useremail + "   " +
                                       acct_cc_type + "   " +
                                       acct_cc_number + "   " +
                                       acct_cc_expyr + "   " +
                                       acct_cc_expmo + "   " +
                                       acct_userpassword + "   " +
                                       acct_userbalance);
                connection.commit();
                statement.close();
             return mainvector;
            } catch(Exception e) {
                System.err.println("System Exception in selectAccounts");
                System.err.println(e);
                throw e;
        }

    line 217 and 218 is
    Account anAccount = (Account) accounts.get(i);
    accountSequence[i-1] = anAccount.getAccountStruct();
    i realized that
    Account anAccount = (Account) accounts.get(i);
    was a typo. what it should have been was
    Account anAccount = (Account) results.get(i);
    so my getAllAccounts() method now looks like
       * getAllAccounts is used to retrieve all existing Accounts in the system
       * @return AccountStruct[] containing all existing Accounts.
       * @fyi returns an empty sequence if no Accounts exist
      // GetAllAcounts method v. 2 - rather than enumerating through the vector
      // call a method that returns a collection of objs in that method where
      // you do select stmts
      public AccountStruct[] getAllAccounts() {
        // Allocate the array of AccountStructs.
        Vector results = new Vector();
        try {
                results = selectAccounts();
        catch(Exception e) {
               e.printStackTrace();       
        //Vector results = selectAccounts();
        int lastKey = results.size();
        //int lastKey = accounts.size();
        AccountStruct[] accountSequence = new AccountStruct[lastKey];
        if (lastKey==0) {
          return accountSequence;
        // Create AccountStructs from Accounts.
        for (int i = 1; i <= lastKey; i++) {
          Account anAccount = (Account) results.get(i);
          accountSequence[i-1] = anAccount.however, i still get the same runtime errors.
    is my selectAccounts() method returning a null?

  • Getting Error while Execute SSIS Package from Console Application

    Dear All,
    SSIS package working fine directly.
    I got following error while execute SSIS package from C# console application.
    The connection "{79D920D4-9229-46CA-9018-235B711F04D9}" is not found. This error is thrown by Connections collection when the specific connection element is not found.
    Cannot find the connection manager with ID "{79D920D4-9229-46CA-9018-235B711F04D9}" in the connection manager collection due to error code 0xC0010009. That connection manager is needed by "OLE DB Destination.Connections[OleDbConnection]"
    in the connection manager collection of "OLE DB Destination". Verify that a connection manager in the connection manager collection, Connections, has been created with that ID.
    OLE DB Destination failed validation and returned error code 0xC004800B.
    One or more component failed validation.
    There were errors during task validation.
    Code : 
       public static string RunDTSPackage()
                Package pkg;
                Application app;
                DTSExecResult pkgResults;
                Variables vars;
                app = new Application();
                pkg = app.LoadPackage(@"D:\WORK\Package.dtsx", null);
         Microsoft.SqlServer.Dts.Runtime.DTSExecResult results = pkg.Execute();
    I have recreate the application with again new connection in SSIS.
    Still not working, Please provide solution if any one have.
    DB : SQL Server 2008 R2
    Thanks and regards,
    Hardik Ramwani

    The connection "{79D920D4-9229-46CA-9018-235B711F04D9}" is not found. This error is thrown by Connections collection when the specific connection element is not found.
    Cannot find the connection manager with ID "{79D920D4-9229-46CA-9018-235B711F04D9}" in the connection manager collection due to error code 0xC0010009. That connection manager is needed by "OLE DB Destination.Connections[OleDbConnection]"
    in the connection manager collection of "OLE DB Destination". Verify that a connection manager in the connection manager collection, Connections, has been created with that ID.
    Are you sure that you are running the same package via .NET which works fine from Visual Studio?
    By reading error message, I can say that you have copied OLEDB task from another package OR you have deleted one OLEDB connection manager. Now when package is run this task tries to use the connection manager and not found thus throws error message.
    Open all OLEDB destination tasks and you find connection manager missing. Connection Manager name should be provided there
    Cheers,
    Vaibhav Chaudhari
    MCSA - SQL Server 2012

  • Dynamically change the db and server in execute sql task

    Pkg 2: Moves data from B_STG (Staging DB) to B_Det_STG (Staging DB)  ---- option1
    Pkg 3: Moves data from B_STG (Staging DB) to B_Det (PC DB)   ---- option2
    This part is duplicating in both the packages
    So they want me to merge both of them into in execute sql task and dynamically change between option1 and option2 depending on a pkg level variable.
    So, I create a pkg level variable called ExecutionVariable: 'ANALYSIS' or 'LOADING'
    If 'ANALYSIS' it needs to do option1 else option2.
    So, I ma trying to create a dynamic connection string in execute sql task.
    I change the connection property in execute sql task editor dynamically my giving the expression: @[User::ExecutionVariable] == "ANALYSIS"?  @[User::STAGINGDBConnectionString] :  @[User::PCDBConnectionString]
    which evaluates to : Data Source=AW-ETL-D1;Initial Catalog=Staging;Integrated Security=SSPI;Provider=sqloledb
    But when I run the sql task, its giving me an error: 
    ERROR:
    TITLE: Microsoft Visual Studio
    Nonfatal errors occurred while saving the package:
    Error at PC_DataLoad: The connection "Data Source=AW-ETL-D1;Initial Catalog=Staging;Integrated Security=SSPI;Provider=sqloledb" is not found. This error is thrown by Connections collection when the specific connection element is not found.
    Error at PC_DataLoad: The connection "Data Source=AW-ETL-D1;Initial Catalog=Staging;Integrated Security=SSPI;Provider=sqloledb" is not found. This error is thrown by Connections collection when the specific connection element is not found.
    Can u please help me.

    Hi ,
    Don't try to make the "Execute Sql" task as dynamic.
    Try to make OLEDB connection Manager as "Dynamic".
    Steps:
    1. Create OLE DB Connection pointing to any database then set expression to connection string variables like below.
    Provider=SQLNCLI10.1;Integrated Security=SSPI;Initial Catalog=YourDBname;Data Source=YourServerName.
    2. Make Delayed Validation property to "True".
    3. Set the created dynamic OLE DB connection to your Execute SQL task.
    4. Change the connection string variable accordingly before running the "Execute SQL" task.
    Hope it will help you.
    Regards,
    Nandhu

  • Problem Installing and Configuring MapBox???

    Hello,
    We are running <b>CRM 5.0 SP11</b> and we had selected MapBox Component when installing CRM itself. Now, we are trying to Configure MapBox as per the
    instructions given in <b>MapBox 4.0 SP11 Installation Guide</b>. We are in doubt  and confused at the step where we have to create RFC Destination for the
    MapBox under SM59 Transaction. For entering the ProgramID, we checked the table <b>ISPCFG</b> for <b>PARNAME</b> value as <b>MAPBOX_RFC_DESTINATION</b> and got following values:
    MANDT          200
    PARNAME     MAPBOX_RFC_DESTINATION
    SITETYPE     
    PARVAL          MAPBOX
    PARVAL2
    REMARK
    CREATEDBY
    CREATEDAT
    CHANGEDBY
    CHANGEDAT
    Isn't it necessary that the <b>PARVAL</b> be something like <b>MAPBOXxxx</b> where <b>xxx</b> be the client number? For now, we created the RFC Destination with Program ID as <b>MAPBOX</b>
    and finished rest of configuration steps and restarted the CRM Server. Now when we are trying to access our CRM Server MapBox Configuration page we are getting following error message:
    Application error occurred during request processing.
      Details:   Error [javax.servlet.ServletException: The client attribute of connection element under status element of
    MapBox meta document is improper.], with root cause [com.sap.syncpoint.mapboxlauncher.MBXLauncherException: The client attribute
    of connection element under status element of MapBox meta document is improper.].
    Exception id: [0019B90D84590065000000D90000131C000432A36A4D99D8]
    Following is the content of mapboxmeta.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <mapboxmeta page="configuration">
         <configuration settings="connection">
              <general_settings MBLauncherTrace="2" MBLTraceSize="5m" max_elements_document="50"
    cache_threshold="50" max_elements_cache="100" parallel_instances="1" thread_priority="2" atom_reuse_count="0"
    MaxCommitInterval="300" LogAndDumpsDir="" InputPayload="no"></general_settings>
              <Lock_Server_Settings Log_Level="1" Operation_Mode="OUTPROC_CLIENT" Registry_Port="59856"
    HostName="localhost" LocalName="Server" PollingInterval="-1" CleanUpInterval="60"></Lock_Server_Settings>
              <JCO msg_sys="<FQDN_CRM_SERVER_HOSTNAME>" sap_system="CRM" sap_gateway="sapgw01" sap_grpname="PUBLIC"
    TraceLevel="0" Unicode="yes"></JCO>
              <JDBC driver="com.inet.tds.TdsDriver" url="jdbc:inetdae7:hostname?database=mapbox" owner="dbo"></JDBC>
              <db_access kind="JCO"></db_access>
              <connection_parameters connid="0">
                   <connection_def>
                        <logon client="200" user="admin1" password="Password123" language="EN" destination="MAPBOX"></logon>
                        <ancillary_settings NumOfInstances="1" MapLogLevel="1D" messagedumps="no" statsfile="no"
    syslog="local_fs" upperlimit="-1" MapLog_Format="default"></ancillary_settings>
                   </connection_def>
              </connection_parameters>
         </configuration>
         <status text="">
              <connection client="200" state="disconnected" connid="0">
                   <item jobid="" qname="" result=""></item>
              </connection>
         </status>
    </mapboxmeta>
    What could have we done wrong? Please guide. Thanks and Regards,
    Vasu

    Thanks Pradeep for the response. I think the root cause of my problem is with RFC Destination creation itself. I have entered the following details (or check <a href="http://www.imagesharing.net/images/gshrinivas124/settings.jpg">this</a> screenshot) when creating RFC Destination:
    RFC Destination Name: Mapbox
    Connection Type: T (TCP/IP Connection)
    Description: Mapbox
    Under Technical Settings tab:
    Activation Type: Registered Server Program
    Program ID: MAPBOX
    Gateway Host: 192.168.0.252
    Gateway Service: sapgw01
    And when i run Connection Test, i am getting following (or check <a href="http://www.imagesharing.net/images/gshrinivas124/error.jpg">this</a> screenshot) error messages:
    Logon     Connection Error
    Error Details     Error when opening an RFC connection
    Error Details     ERROR: program MAPBOX not registered
    Error Details     LOCATION: SAP-Gateway on host ERPSERV / sapgw01
    Error Details     DETAIL: TP MAPBOX not registered
    Error Details     COMPONENT: SAP-Gateway
    Error Details     COUNTER: 67914
    Error Details     MODULE: gwr3cpic.c
    Error Details     LINE: 1684
    Error Details     RETURN CODE: 679
    Error Details     SUBRC: 0
    Error Details     RELEASE: 700
    Error Details     TIME: Tue Jun 12 15:04:47 2007
    Error Details     VERSION: 2
    I have already checked Services file and there already exists the entry for sapgw01. Also the ProgramID that i have entered for RFC Destination i.e., MAPBOX matches with the entry in the table ISPCFG for Paramaeter MAPBOX_RFC_DESTINATION. What am i doing wrong in creating RFC Destination? Thanks again.
    Regards,
    Vasu

  • A shared Text editor - question about JEditorPane

    Hi there,
    I'm trying to make a shared Text Editor. So far I have the ability to pass messages across from one client to another. I have all the GUI elements in the "main" Class, and the Connection elements in separate Classes; in particular the receivedPacket method which listens for specific packets. Now I'm able to print in my Terminal window the received packets (via a simple System.out.println call). Is it possible to grab the packet information from the "main" Class and then append that information to the JEditorPane (which has been constructed in the main Class)? Or would it be better to create the JEditorPane in the Class with the receivedPacket and then add the information straight away to the editor window?
    Thanks
    :)

    Thanks for the guidance, I think you're right. Nice to hear you've done something similar.
    What I have up and running is:
    1) GUI elements created in the main class (Class Exchange)
    2) A Connection class that handles the connection to the server and adds packet listeners to the incoming packets (Class Connection)
    3) A class that filters and stores the packets (Class Comms)
    Now I'm using a protocol called Jabber (instant messaging protocol) so I'm using the JabberBeans library for all Jabber stuff (i.e. Connection and packet listeners etc..). Now the receivedPackets method within the Comms Class then extracts the <body> of what I want to another method within the Comms Class which then returns that String value. This works as it prints to the Terminal window when run and packets are received.
    What I'm having difficulty in understanding (although I think its straightforward) is why I can't take that returned value and have it update in my JEditorPane window (which is in the main Class (Exchange)), it doesnt like it for some reason and complains about something from the JabberBeans library.
    I'm unsure about how to update the JEditorPane; would it be to write a method in the main class that calls in the returned <body> String value (which is what I thought would be right)? Or is there something else I've missed. In the JabberBeans API the returned value is of type String, I'm guessing that maybe I need to move that into a StringBuffer for the sake of the JEditorPane.. Or is that just guessing?
    Thanks for the help, hope you get a moment..
    AB
    :)

Maybe you are looking for

  • Transfer data from iphone 3g to ipad

    how to transfer data, contact list, from iphone 3g to an ipad

  • Webdings font used infopath list form not displaying in firefox

    We are using expand and collapse functionality in infopath 2010 using section along with buttons. We are using button text as webdings font to display up and down arrow mark. This works fine on IE. But not on firefox instead of arrow its displaying n

  • Backup/sync has stopped working

    My backup/sync stopped working in the middle of a backup three days ago.  But PSE7 shows that backup/sync is working normally (green arrows).  It also shows files pending back up.  Synchronization is turned on for the album's needing back up. I have

  • 12c agent patching

    When creating a plan to patch agents the analyze phase really takes a long time and so does the deployment phase. Does anyone have any experience using emcli for patching agents? I'm curious what the results are. In our configurations we're dealing w

  • Which Format/Camcorder best for PE7

    Dear Experts: I am just starting out making DVD memoirs for hospice patients (mostly interior head shots). I just acquired PE7 am learning and need to buy a camcorder, which with the different formats(mini dv, HDD, SDHC) is very confusing . The Canon