Swap of Datasources

Hi,
We had used 0FI_AR_3 datasource and complete dataflow till infocube is made. The data is taken on monthly basis as 0FI_AR_3 datasource supports only Full update mode. Later, we had seen the 0FI_AR_4 datasource, supporting delta mode.
How to restructure the whole dataflow with the new datasource?
Thanks in advance.

Hello harpriya,
You would have to create a new data flow structure for 0FI_AR_4 data source, the same way u did for 0FI_AR_3 datasource,and then you may then later on delete the data flow i.e. transformation and infopackages etc corresponding to previous data source.
Regards
Priyanka

Similar Messages

  • Verifying DSN reports Datasource not found?

    Hello, thanks for looking..
    I have two datasources configured on a production web server (Win IIS, CF8), one that connects to a remote database and the other connects to a local database. A web application I was in the process of migrating to a new server used the datasource that connected to the remote database as I was taking one step at a time. Yesterday became the day to make the final jump and to migrate the database, so after comparing the two databases (SQL Delta is a beautiful tool), I proceded to swap the datasources by renaming them in the ColdFusion Administrator. I renamed the datasource to the remote database to some arbitrary backup name, then renamed the datasource to the local database to the original name of the the datasource to the remote database.
    JDBC, ODBC, whatever, I have probably performed these same steps hundreds of times without an issue. Yesterday, after renaming the datasource, verifying it, confirming it was working by browsing the application and seeing the noticable performance increase from accessing a local database, I was content to call to process complete.
    At 3am server time however, the application began throwing errors, saying the datasource could not be found. I jumped into CF Admin to check everything out and found things just as I left them, two datasources, one named as a backup and the other the original name to the local database. When I clicked verify all however, the datasource to the local database failed, saying "Datasource could not be found".
    I am curious as to what may have happened here. I don't see any cause for alarm with regards to technique as I have been using it for so long. ColdFusion server.log shows no sign of a restart. Does anyone have any clue what could have happened here? How could a datasource appear in CF Admin, yet verifying it says it doesn't exist? I resolved the problem by renaming it to something else, then renaming it back but I plan on deleting and recreating it completely this evening when traffic is lower. My only guess here is that ColdFusion updated active memory but failed when updating the registry, then something happened where things were refreshed.. But why.. and how can that be detected/avoided if true?
    I have a lot of people asking me questions now, and after spending great amount of time convincing them ColdFusion is the best answer for their needs the first time around, I am having trouble doing so this second time. So thank you in advance for any help or insight..
    Mike

    I am okay with that, and a 1 in 200ish failure rate, especially now that I have an automated script verifying datasources regularly. My clients are not however, especially without understanding the cause. Thanks for the reply though.
    Well, if that client was mine, I'd be saying something along these lines:
    "I've investigated this as much as practical, and asked around the CF community, and no-one has heard of this happening.  Given it's an isolated occurrence, I'm prepared to put this down to a temporary aberration, which is now resolved.  "Case closed", although obviously we'll "watch this space" too.  All computer software is very complex, and there will always be glitches.  I can investigate this to conclusion if you like, but it's difficult to troubleshoot something after havnig fixed it, especially when it's not replicable.  I am satisfied this is not something to be concerned about, however if you really want me to get to the bottom of it, it's likely to take a week (billable, as it's not a good use of my time), and at the end of it, you're not going to be any better off.  If it's such a concern - and fair enough - that there's a single point of failure here, then let's start talking about some fail-over protection.  That way if any other aberrations present themselves, it will not be an issue".
    However, in the mean time, have a look at your JRun and CF logs at round about the time the problem happened, and see if there's anything in there to do with JDBC and the like.
    Adam

  • Erro on opning Webi report.

    Post Author: sunchega
    CA Forum: WebIntelligence Reporting
    Hi Friends,
    I am using IE 6.0 for WebI reporting.I am able to modify/view the report using the "modify" link available at the bottom of the report name. But when I click on the Report name link DIRECTLY for viewing the report, it does not display the report instead gives me an error (Error on Page) on the status bar of IE.

    Hi Dennis,
    Thank you! My issue was to find the "change data source" button and then to swap the datasources. I can also confirm that you can change the connection from an MDX universe to a BICS connection on top of a BEx query and vice versa. The typical "match object" dialogue window appears and you can match your objects from the current to the new data source easily. Very sleek indeed!
    Cheers
    Sven

  • Swapping XML Parser and XSLT to Xalan 2.7.0 - Not Working (OC4J 10.1.3)

    Hi-
    I'm trying to use the latest Xercies/Xalan classes in OC4J 10.1.3 as described in the How-To swap XML Parsers document:
    http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html
    What I can see happening is that the oracle.xml shared library is successfully 'turned off', but the xalan libraries are not added. Instead, the default xml classes that are distributed with the JDK become visible. For instance, using a slightly modified version of the index.jsp page from the how-to, I get this result:
    ------ Output from JSP page ----------------
    TransformerFactory Instance: org.apache.xalan.processor.TransformerFactoryImpl
    Transformer Instance: org.apache.xalan.transformer.TransformerIdentityImpl
    Transformer Version: Xalan Java 2.4.1 (!!)
    What I expect is for that last line to say version 2.7.0, which is the version of the xalan.jar included in my shared library (code to add that line to the how-to shown below).
    I suspect what is happening is that the class loader is simply not letting a shared library override a system library - to do that you probably need to place the jar files in system endorsed directory.
    Has anyone gotten this how-to to work - actually replacing the XML parser/transform classes with the latest Xalan classes? Are you sure it is seeing the current version you placed in the shared library?
    Thanks,
    Eric Everman
    ---- My modified getXSLTDetails() method in the index.jsp page of the how-to -------
    <!-- Additional Import -->
    <%@ page import="org.apache.xalan.Version" %>
    public static String getXSLTDetails()
    Transformer transformer=null;
    TransformerFactory transformerfactory = TransformerFactory.newInstance();
         Version ver = null;
         String br = "<" + "br" + ">"; //otherwise the otn forum chocks on the break.
    try
    transformer = transformerfactory.newTransformer();
              ver = (Version) transformer.getClass().forName("org.apache.xalan.Version").newInstance();
              String ret_val =
                   "TransformerFactory Instance: "+transformerfactory.getClass().getName() + br +
                   "Transformer Instance: "+transformer.getClass().getName() + br;
              if (ver != null) {
                   ret_val = ret_val + "Transformer Version: " + ver.getVersion() + br;
              } else {
                   ret_val = ret_val + "Transformer Version not Available" + br;
              return ret_val;
    catch (Exception e)
    e.printStackTrace();
    return e.getMessage();
    }--------------------------------------------------------------------

    Steve - Thanks for responding on this.
    The Xalan SQL extension is built into Xalan. The most painless way to try it out is to run it via JEdit: www.jedit.org
    JEdit a OS Java application with a fairly painless install process (I'm assuming you already have a current JRE installed). Once its installed, you'll need to install the XSLT plugin - in JEdit goto Plugins | Plugin Manager | Install and pick the XSLT plugin. You'll need the Oracle JDBC classes on your classpath - this can be done by copying the oracle_jdbc4.jar into the [JEdit install directory]/jars directory.
    Restart to load that jar and you should be all set.
    I included a sample XSLT page at the bottom of this post that is somewhat of a template transform for the SQL extension - its more complicated then it needs to be, but it does some nice things with the results of the query. Save it as a file and make the appropriate changes to the 'datasource' parameter near the top of the file.
    Then in JEdit, open the file and make sure the XSLT plugin is visible (Plugins | XSLT | XSLT Processor Toggle - or alternately dock it in the window via global prefs). In the XSLT plugin: Allow the current buffer to be used as the source, Add that same file as a stylesheet via the '+' button, and pick a result file at the bottom. Then click the 'Transform XML' button.
    Troubleshooting: I seem to remember having some classpath errors when I tried this on windows, but others have had it work w/o issues. I do remeber that the XSLT plugin had a popup window that gave a pretty good explaintion of the problem, if it occurs. Also, for some reason the XSLT plugin will not create a new file for the output, so its often best to create a file first, then choose it as the output. Of course, you can always run a transformation from the command line or w/in an applicatoin. Full docs on the Xalan SQL extension can be found at: http://xml.apache.org/xalan-j/extensionslib.html#sql
    Here is my sample XSLT transform using the SQL extension:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              xmlns:sql="http://xml.apache.org/xalan/sql"
              xmlns:str="http://exslt.org/strings"
              xmlns:xalan="http://xml.apache.org/xalan"
              extension-element-prefixes="sql str xalan">
         <xsl:output indent="yes"/>
         <xsl:param name="driver">oracle.jdbc.OracleDriver</xsl:param>
         <xsl:param name="datasource">jdbc:oracle:thin:jqpublic/jqpublic@server_name:1521:dbname</xsl:param>
         <xsl:param name="jndiDatasource"><!-- jndi source for production use w/in enterprise environment --></xsl:param>
         <xsl:param name="debug">true</xsl:param>
         <xsl:variable name="connection" select="sql:new()"/>
         <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
         <xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"/>
         <!--
              The query:  You could pass parameters in to this query to build a where clause, but here is a simple example.
              Also, its nice to wrap the query with a max row number to prevent huge results.
         -->
         <xsl:param name="query">
         select * from (
      SELECT
              'One' FIELD_1,
              'Two' FIELD_2
         FROM DUAL
         ) where rownum < 100
         </xsl:param>
         <!-- Essentially, create a XConnection object -->
         <xsl:variable name="connection" select="sql:new()"/>
         <xsl:template match="/">
        <xsl:choose><!-- Connect using JNDI -->
          <xsl:when test="$jndiDatasource != ''">
            <xsl:if test="not(sql:connect($connection, $jndiDatasource))">
              <xsl:message>Failed to connect to db via jndi connection</xsl:message>
              <xsl:comment>Failed to connect to db via jndi connection</xsl:comment>
              <xsl:if test="$debug = 'true'">
                <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
            </xsl:if>
          </xsl:when>
          <xsl:otherwise><!-- Connect using connection string -->
            <xsl:if test="not(sql:connect($connection, $driver, $datasource))">
              <xsl:message>Failed to connect to db via driver/url connection</xsl:message>
              <xsl:comment>Failed to connect to db via driver/url connection</xsl:comment>
              <xsl:if test="$debug = 'true'">
                <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
            </xsl:if>
          </xsl:otherwise>
        </xsl:choose>
              <!--
              The results of the query.  The rowset is brought back in 'streaming' mode,
              so its not possible to ask it for the number of rows, or to check for zero
              rows.  There is a switch to disable streaming mode, but this requires all
              rows to be brought into memory.
              -->
              <xsl:variable name="table" select="sql:query($connection, $query)"/>
              <xsl:if test="not($table)">
                   <xsl:message>Error in Query</xsl:message>
                   <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
              <page>
                   <!-- Your xalan environment -->
                   <xsl:copy-of select="xalan:checkEnvironment()"/>
                   <!-- Build a bunch of metadata about the rows -->
                   <meta>
                        <cols>
                             <xsl:apply-templates select="$table/sql/metadata/column-header"/>
                        </cols>
                   </meta>
                   <rowset>
                        <!--
                             With streaming results, you must use the apply-temmplates contruct,
                             not for-each, since for-each seems to attempt to count the rows, which
                             returns zero.
                        -->
                        <xsl:apply-templates select="$table/sql/row-set"/>
                   </rowset>
              </page>
              <xsl:value-of select="sql:close($connection)"/><!-- Always close -->
         </xsl:template>
         <xsl:template match="row">
              <row>
                   <xsl:apply-templates select="col"/>
              </row>
         </xsl:template>
         <xsl:template match="column-header">
              <col>
                   <xsl:attribute name="type">
                        <xsl:value-of select="@column-typename"/>
                   </xsl:attribute>
                   <xsl:attribute name="display-name">
                        <xsl:call-template name="create-display-name"/>
                   </xsl:attribute>
                   <xsl:value-of select="@column-name"/>
              </col>
         </xsl:template>
         <!-- Convert column names to proper caps: MY_FIELD becomes My Field -->
         <xsl:template name="create-display-name">
              <xsl:variable name="col-name">
                   <xsl:for-each select="str:tokenize(@column-name, '_')">
                        <xsl:value-of
                             select="concat(translate(substring(., 1, 1), $lowercase, $uppercase), translate(substring(.,2), $uppercase, $lowercase), ' ')"/>
                   </xsl:for-each>
              </xsl:variable>
              <xsl:value-of select="substring($col-name, 1, string-length($col-name) - 1)"/>
         </xsl:template>
         <!-- Creates data columns named 'col' with a column-name attribute -->
         <xsl:template match="col">
              <col>
                   <xsl:attribute name="column-name"><xsl:value-of select="@column-name"/></xsl:attribute>
                   <xsl:value-of select="."/>
              </col>
         </xsl:template>
    </xsl:stylesheet>

  • Generic Extraction (or) How to use table in R/3 system as datasource in BW?

    Hi all,
    Hope all are having a great day
    Can any1 tell me the steps, for Generic Extraction.
    It will be very helpful, if the steps are as much as simpler as posible.
    I know to create a simple cube in BW.
    I have this much knowledge, depending on this can any1 tell me the steps for Generic Extraction from R/3.
    examples wud be vry useful
    Regards,
    Sourav

    hi,
    Maintaining Generic DataSources 
    Use
    Independently of application, you can create and maintain generic DataSources for transaction data, master data attributes or texts from any kinds of transparent tables, database views, InfoSets of the SAP query or using a function module. As a result, you can make use of the generic extraction of data.
    Procedure
    Creating a Generic DataSource(RSO2)
           1.      Select the DataSource type and give it a technical name.
           2.      Choose Create.
    The creating a generic DataSource screen appears.
           3.      Choose an application component to which the DataSource is to be assigned.
           4.      Enter the descriptive texts. You can choose any text.
           5.      Choose from which datasets the generic DataSource is to be filled.
                                a.      Choose Extraction from View, if you want to extract data from a transparent table or a database view. Enter the name of the table or the database view.
    After generation, you get a DataSource whose extract structure is congruent with the database view or the transparent table view.
    For more information about creating and maintaining database views and tables, see the ABAP Dictionary Documentation.
                                b.      Choose Extraction from Query, if you want to use a SAP query InfoSet as the data source. Select the required InfoSet from the InfoSet catalog.
    Notes on Extraction Using SAP Query
    After generation, you now have a DataSource whose extract structure matches the InfoSet.
    For more information about maintaining the InfoSet, see the System Administration documentation.
                                c.      Choose Extraction using FM, if you want to extract data using a function module. Enter the function module and extract structure.
    The data must be transferred by the function module in an interface table E_T_DATA.
    Interface Description and Extraction Process Flow
    For information about the function library, see the ABAP Workbench: Tools documentation.
                                d.      With texts, you also have the option of extraction from domain fixed values.
           6.      Maintain the settings for delta transfer where appropriate.
           7.      Choose Save.
    When extracting, look at SAP Query: Assigning to a User Group.
    Note when extracting from a transparent table or view:
    If the extract structure contains a key figure field, that references to a unit of measure or currency unit field, this unit field must appear in the same extract structure as the key figure field.
    A screen appears in which you can edit the fields of the extract structure.
           8.      Editing the DataSource:
    &#61601;        Selection
    When scheduling a data  request in the BW Scheduler, you can enter the selection criteria for the data transfer. For example, you may want to determine that data requests are only to apply to data from the previous month.
    If you set the Selection indicator for a field within the extract structure, the data for this field is transferred in correspondence with the selection criteria in the scheduler.
    &#61601;        Hide field
    You should set this indicator to exclude an extract structure field from the data transfer. As a result of your action, the field is no longer made available in BW when setting the transfer rules and generating the transfer structure.
    &#61601;        Inversion
    Reverse postings are possible for customer-defined key figures. For this reason, inversion is only possible for certain transaction data DataSources. These include DataSources that have a field that is indicated as an inversion field, for example, the field update mode in the DataSource 0FI_AP_3. If this field has a value, then the data records are interpreted as reverse records in BW.
    Set the Inversion indicator if you want to carry out a reverse posting for a customer-defined field (key figure). The value of the key figure is then transferred in inverted form (multiplied by –1) into BW.
    &#61601;        Field only known in exit
    You can enhance data by extending the extract structure for a DataSource using fields in append structures.
    The indicator Field only known in Exit is set for fields of an append structure. In other words, by default these fields are not passed onto the extractor from the field list and selection table.
    Deselect the indicator Field Only Known in Exit to enable the Service API to pass on the append structure field to the extractor together with the fields of the delivered extract structures in the field list as well as in the selection table.
    9. Choose DataSource ® Generate.
    The DataSource is now saved in the source system.
    Maintaining Generic DataSources
    •        Change the DataSource
    To change a generic DataSource, in the initial screen of DataSource maintenance, enter the name of the DataSource and choose Change.
    You can change the assignment of a DataSource to an application component as well as the texts of a DataSource. Double-clicking on the name of the table, view, InfoSet or extract structure takes you to the appropriate maintenance screen. Here you can make changes required to add new fields. You can fully swap transparent tables and database views, but not InfoSets. If you return to the DataSource maintenance and choose Create, the screen for editing a DataSource appears. To save the DataSource in the SAP source system, choose DataSource  ® Generate.
    If you want to test extraction in the source system independently of a BW system, choose DataSource  ®  Test Extraction.
    •        Delta DataSource
    In the Change Generic DataSource screen, you can delete any DataSources that are no longer relevant. If you are extracting data from an InfoSet, delete the associated query. If you want to delete a DataSource, this must not be connected to a BW system.
    For more information about extracting using SAP Query, see Extraction using the SAP Query.
    hope this helps.
    assign point if so
    partha

  • ORA-01002: fetch out of sequence using multiple XA datasources

    Hi,
    I have a problem accessing multiple XA datasources :
    - launch an sql request on datasource 1
    - rs.next() on the resultset
    - use the data to launch another sql request on datasource 2
    After 10 iterations, the next() method throws an SQLException (ORA-01002: fetch out of sequence).
    After further investigation, I noticed that :
    - the problem doesn't occur if the same datasource is used for the 2 requests
    - if I set the fetch size to 15 for the first request, the exception is thrown after 15 iterations (but I can't use this as a workaround because the number is potentially above the million).
    Anyone experiencing the same problem ?
    Thanks in advance
    Nicolas
    Here's my configuration :
    - Weblogic 8.1 SP4
    - JDK sun 1.4.2_04 (we have the same problem with various JDKs including JRockit)
    - Oracle 10g
    - Oracle thin driver xa 10.1.0.2.0
    A JSP I use to reproduce the problem :
    <pre><%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ page import="java.util.ArrayList,
                        java.sql.Connection,
                        java.sql.PreparedStatement,
                        java.sql.ResultSet,
                        java.sql.SQLException,
                        javax.naming.InitialContext,
                        javax.naming.NamingException,
                        javax.sql.DataSource,
                        javax.transaction.UserTransaction"%>
    <%!
         public void launchTest() throws Exception {
              Connection cnx =null ;
              try {
                   getUserTransaction().begin();
                   // SQL access #1
                   cnx = getConnection("jdbc/xaDatasource1");
                   PreparedStatement stmt = cnx.prepareStatement("SELECT test_col from test_table");
                   ResultSet rs = stmt.executeQuery();
                   // iterate on resulset from SQL 1
                   int i=1;
                   while (rs.next()){ // SQL exception after 10 iterations
                        System.out.println(i + "");
                        i++;
                        // SQL access #2
                        Connection cnx2 = getConnection("jdbc/xaDatasource2");
                        // problem occurs even if we don't request
                        cnx2.close();
                        // end SQL access #2
                   getUserTransaction().commit();
              } catch (Exception e) {
                   e.printStackTrace();
                   try {
                        getUserTransaction().rollback();
                   } catch (Exception e1) {
                        e1.printStackTrace();
                        throw e;
              } finally {
                   try {
                        if (cnx != null && !cnx.isClosed())
                             cnx.close();
                   } catch (Exception e1) {
                        e1.printStackTrace();
         private UserTransaction getUserTransaction() throws NamingException {
              return (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
         private Connection getConnection(String jndiName) throws NamingException, SQLException {
              DataSource ds = (DataSource) new InitialContext().lookup(jndiName);
              return ds.getConnection();
    %>
    <%
    launchTest();
         SQL CODE :
         CREATE TABLE TEST_TABLE (     TEST_COL NUMBER(2));
         insert into test_table values(1);
         insert into test_table values(2);
         insert into test_table values(3);
         insert into test_table values(4);
         insert into test_table values(5);
         insert into test_table values(6);
         insert into test_table values(7);
         insert into test_table values(8);
         insert into test_table values(9);
         insert into test_table values(10);
         insert into test_table values(11);
    %>
    </pre>

    Nicolas Mervaillie wrote:
    Hi,
    I have a problem accessing multiple XA datasources :
    - launch an sql request on datasource 1
    - rs.next() on the resultset
    - use the data to launch another sql request on datasource 2
    After 10 iterations, the next() method throws an SQLException (ORA-01002: fetch out of sequence).
    After further investigation, I noticed that :
    - the problem doesn't occur if the same datasource is used for the 2 requests
    - if I set the fetch size to 15 for the first request, the exception is thrown after 15 iterations (but I can't use this as a workaround because the number is potentially above the million).
    Anyone experiencing the same problem ?Hi. This is a known weakness of Oracle. If the XA transactional context of a connection
    changes during a result set processing, even if it is switched back correctly, the result
    set is aborted. If the oracle driver has fetched 10 rows, that's all you get. The next
    call to next() that needs real DBMS communication will fail.
    By spec, an XA connection should be able to be swapped out and enlisted in different
    transactions at a per-call granularity, so our pools allow that by default. Try setting
    the KeepXAConnTillTxCOmplete setting in your pool.
    When a connection is put back in the pool, if it is an XA connection we will suspend
    any user tx, and test it with our own test tx, then re-enlist and re-start the user
    tx in flight. This may be the context switch that kills the oracle result set.
    Joe
    >
    Thanks in advance
    Nicolas
    Here's my configuration :
    - Weblogic 8.1 SP4
    - JDK sun 1.4.2_04 (we have the same problem with various JDKs including JRockit)
    - Oracle 10g
    - Oracle thin driver xa 10.1.0.2.0
    A JSP I use to reproduce the problem :
    <pre><%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ page import="java.util.ArrayList,
                        java.sql.Connection,
                        java.sql.PreparedStatement,
                        java.sql.ResultSet,
                        java.sql.SQLException,
                        javax.naming.InitialContext,
                        javax.naming.NamingException,
                        javax.sql.DataSource,
                        javax.transaction.UserTransaction"%>
    <%!
         public void launchTest() throws Exception {
              Connection cnx =null ;
              try {
                   getUserTransaction().begin();
                   // SQL access #1
                   cnx = getConnection("jdbc/xaDatasource1");
                   PreparedStatement stmt = cnx.prepareStatement("SELECT test_col from test_table");
                   ResultSet rs = stmt.executeQuery();
                   // iterate on resulset from SQL 1
                   int i=1;
                   while (rs.next()){ // SQL exception after 10 iterations
                        System.out.println(i + "");
                        i++;
                        // SQL access #2
                        Connection cnx2 = getConnection("jdbc/xaDatasource2");
                        // problem occurs even if we don't request
                        cnx2.close();
                        // end SQL access #2
                   getUserTransaction().commit();
              } catch (Exception e) {
                   e.printStackTrace();
                   try {
                        getUserTransaction().rollback();
                   } catch (Exception e1) {
                        e1.printStackTrace();
                        throw e;
              } finally {
                   try {
                        if (cnx != null && !cnx.isClosed())
                             cnx.close();
                   } catch (Exception e1) {
                        e1.printStackTrace();
         private UserTransaction getUserTransaction() throws NamingException {
              return (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
         private Connection getConnection(String jndiName) throws NamingException, SQLException {
              DataSource ds = (DataSource) new InitialContext().lookup(jndiName);
              return ds.getConnection();
    %>
    <%
    launchTest();
         SQL CODE :
         CREATE TABLE TEST_TABLE (     TEST_COL NUMBER(2));
         insert into test_table values(1);
         insert into test_table values(2);
         insert into test_table values(3);
         insert into test_table values(4);
         insert into test_table values(5);
         insert into test_table values(6);
         insert into test_table values(7);
         insert into test_table values(8);
         insert into test_table values(9);
         insert into test_table values(10);
         insert into test_table values(11);
    %>
    </pre>

  • DAO pattern datasource connection help

    After researching and attempting to implement the Data Access Object pattern using the Abstract Factory pattern I run into one problem for which I haven't found a solution.
    All of the solutions that I have found hardcode the database connection URL and user credentials into either the concrete DAO factory or the concrete DAO object iteself. However, in the application that I am working with, the user credentials will be entered on a login screen and passed into the business objects that reference the data access objects.
    My questions are:
    Which object should receive the user credentials and datasource URL to authorize the user? (The storage solution that I am using returns query results based on the user's security settings in the repository.)
    How do I abstract this connection information to ensure that if I swap in a different storage solution I won't have to change the business objects or the interface to the DAO factory/objects?

    Ideally, one should always use the concrete DAOFactory to get you the database specific connection. The reason being that the one concrete DAOFactory exist for one particular database, and creates/returns DAO objects specialized for firing SQLs to that database.
    So writing connection code should be removed from DAO classes and put in the factory class.
    Now, coming to your problem.
    The user credentials are supplied by the user. These credentials are passed on to your business objects that in turn invoke an operation on a particular DAO to fire a SQL and get back the ResultSet.
    The business objects would typically get hold of the AbstractFactory to get the concrete factory, and using the concrete factory handle, it would get the concrete DAO class.
    The DAO class in turn would use the concrete DAOFactory to get a connection, fire SQL, get the ResultSet and close/return the connection.
    So, the best place to handle your issue is to write a public static final method in your AbstractDAOFactory class that returns you a 'fully configured' concrete DAOFactory class. The right time to use your user supplied credentials is when the AbstractFactory is creating your concrete DAOFactory class.
    Why?
    Because, every new user would represent a new database connection to your database. And that new user is allowed to do host of things using the number of DAOs that you have. So, ideally, for every user the JDBC connection setup part should be re-configured.
    So, just have the AbstractFactory return you a re-configured concrete DAOFactory for every new user by passing this AbstractFactory 2 information:
    1. "whichDAOFactory" to return, and
    2. "ConfigVO" ValueObject having the UID/PWD.
    So extending the example given by Sun:
    public static DAOFactory getDAOFactory(int whichFactory, Object ConfigVO)
    switch (whichFactory)
    case CLOUDSCAPE:
    return new CloudscapeDAOFactory().configure(ConfigVO);
    So, just by adding an abstract method configure() in the AbstractDAOFactory class to force all the extending concrete class to define their own ways to configure themselve with the user supplied credentials.
    Regards

  • Lot of time when Datasource is loaded

    I develop a Struts Application that access a App Server managed DataSource. Sun ONE App Server let me create a datasource, but when i access it for the very first time it takes a lot of time.
    I'm running a unique AppServer with 7 Jakarta Struts applications. I configure 4 Datasources with a min connection set of 8 (default value) and a max o 20 (default) but when i stop and start my server it takes about 45 mins to get ready.
    I'm using Oracle 9.2.0.5 and its JDBC Driver (ojdbc14.jar) running in a diferent machine.
    Anyone can tell me why it takes so long ? In the development environment I run my test in a Tomcat Server and it takes a few seconds to start.

    There are lots of possibilities; the top one that springs to my mind is that you have some sort of name resolution (DNS) problem on the problem host. Another is that your application doesn't have enough memory, either physical on the box (causing swap thrash) or in the JVM (causing excess garbage collection).
    Assuming you're using recent Solaris (10) and Java, then Sun's dtrace tool is allegedly the best way to dig into such problems; at JavaOne this year, Sun offered a free iPod to anyone who submitted a working project that couldn't be significantly improved by dtrace profiling - they gave away one iPod.
    http://www.sun.com/software/solaris/javaone_challenge.jsp
    http://www.sun.com/bigadmin/xperts/sessions/13_dtrace/
    If that's not an option, then you can use truss, vmstat, iostat, or mpstat to see if there's some system resource that's the limiting factor; if not, it's something on the net, a concurrency/locking issue or something else in the Java world. I've seen startup problems related to the inability to fetch DTDs over the network, but in those cases the application ultimately fails after "hanging" for a long time...

  • Advanced Data Grid datasource Arraycollection addItem extremly slow

    Hello everyone,
    i want to add 2000 items to my existing arraycollection, which is the datasource for the Advanced Data Grid i made.
    here is the code:
    for(var i:int;i<res.length;i++) {
    var swap:myDataGridObject = incomingdataarray[i];
    datasourcearray.addItemAt(swap,i);
    it takes about 2 minutes .... thats very slow, thinking of one is waiting 2 minutes every time he expanded a node in the tree.
    as a solution i tryied to do it like this:
    datasourcearray = new ArrayCollection( ObjectUtil.copy( incomingdataarray.source ) as Array );
    the result is that it is actually working, but i can not expand my treenodes any longer. there seemed to be no items in there.
    adatagrid.valdiatednow() also has no effect.
    perhaps anybody came across the same thing an can help me out
    thanks
    steff

    Hi,
    first, thank u for your fast answer. I try to add Items to a ArrayCollection which is the dataprovider from my ADG.
    i did this in this way:
    for(var i:int;i<incomingDataArray.length;i++) {
    var swap:myObject = incomingDataArray[i];
    datasourceAC.addItemAt(swap,i);
    i get the data from another method in form of a array collection, which contains many of the myObjects Elements.
    The datasourceAC is the provider as mentioned above. the only way it works for me to add the items to the dataSourceAC and the ADG beeing updated in the
    correct way is this one. but its very slow....
    now i tried your hint like this:
    var sourceArray:Array = datasourceAC.source;
    for(var i:int;i<incomingDataArray.length;i++) {
    var swap:myObject = incomingDataArray[i];
    sourceArray.push(swap);
    datasourceAC.refresh();
    the result is that the nodes are loaded an displayed but i can not expand them any longer. they seemed to be empty.
    as i traced that problem a little closer i realized that my groupingfunction isnt called either.... i dont know wh y;(
    hope that explains everything
    thanks for help
    steffan

  • MimeUtility.encode and a custom DataSource

    I have created a custom DataSource, in which I wrap the OutputStream (returned by getOutputStream()) in a MimeUtility.encode call. When I do this, I seem to be getting an encoded MimeBodyPart, but the 'Content-Transfer-Encoding' is wrong. My DataSource code is:
    public class MyDataSource implements DataSource {
        private String _mimeType; // content-type
        private String _encoding;
        private ByteArrayOutputStream _bao;
        /* Create a DataSource from an input stream */
        public MyDataSource(String mimeType, String encoding){
            _mimeType = mimeType;
            _encoding = encoding;
            _bao = new ByteArrayOutputStream();
        * Return an InputStream for the data.
        * Note - a new stream must be returned each time.
        public InputStream getInputStream()
        throws IOException {
            return new
                ByteArrayInputStream(_bao.toByteArray());
        public OutputStream getOutputStream()
        throws IOException {
            OutputStream out = null;
            try {
                out = MimeUtility.encode(_bao, _encoding);
            } catch (MessagingException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            return out;
        public String getContentType() {
            return _mimeType;
        public String getName() {
            return "MyDataSource";
    }Now, when I invoke the datasource, I call (shortened):
    _dataSource = new MyDataSource(mimeType, "base64");
    _outStream = _dataSource.getOutputStream();
    /* write some data to the output stream here */
    DataHandler dh = new DataHandler(_dataSource);
    mbp.setDataHandler(dh);
    _multiPart.addBodyPart(mbp);
    _message.setContent(_multiPart);
    _message.setHeader("X-Mailer", "HPDS");
    _message.setSentDate(new Date());
    _message.writeTo(System.out);
    Transport.send(_message);This code was obviously cut down and won't compile, but you get the general idea. When I do this, and I look at the output from the 'writeTo', the data is base64 encoded, but the 'Content-Transfer-Encoding' is set to '7bit'. Now, here's the really wierd thing -- if I change the MyDataSource above to use "7bit" instead of "base64", I get encoded data (I believe that it's base64 encoded, but I'm not positive), and the 'Content-Transfer-Encoding' is set to 'base64'. It looks like the two cases are being swapped?
    Has anyone seen something like this? If I set the 'Content-Transfer-Encoding' explicity by calling:
    mbp.setHeader("Content-Transfer-Encoding", "base64");it works fine. Is this a bug? Or am I just misunderstanding where the 'Content-Transfer-Encoding' comes from.
    TIA,
    - Bill

    OK, I figured it out. This isn't explicitly spelled out in the FAQ, but it turns out that Javamail performs the encoding for you, based on the "Content-Transfer-Encoding" header. I was trying to encode the data inside my datasource, and was getting twice-encoded data. I set the 'getOutputStream' in MyDataSource to not call MimeUtility.encode(), and set the C-T-E header before calling Transport.send(). Now everything is working fine.
    - Bill

  • Datasources other than Oracle in JDev 10.1.3 (preview)

    Hi.
    Im evaluating JDev as our primary development tool for JSF and I found that I cant configure data sources for other database than Oracle.
    I set up the connection for FireBird database (in connection s tab) correctly (can see objects and execute queries).
    When I tell to JDev to copy IDE datasources there is no way to tell to OC4J which JDBC driver to use, then I cant test the application.
    I'm using JSTL SQL tags (no ADF).
    Regards.

    I think this paper about swapping the OC4J JDBC drivers might help you:
    http://www.oracle.com/technology/tech/java/oc4j/1013/howtos/how-to-swapjdbclib/doc/how-to-swapjdbclib.html
    It's a new feature in OC4J 10.1.3

  • Closing a Datasource

    Hi,
    we're just upgrading from Oracle9.2 to Oracle11.2 and in this process also swap out the old classes12.jar for the newer ojdbc6.jar Release 11.2.
    Now I notice that the OracleDataSource.close() Method is deprecated. Does it still do anything? I'm asking because we have a Test that closes an old DataSource and creates a new one. But upon trying to get Connections from the newly created DataSource, we get an error stating that a ConnectionCache with this name already exists. I assume the old DataSource still exists with a Connection Cache although we called the close() method.
    Does anyone know how to close an OracleDataSource? Or how to release its ConnectionCache?
    Dirk

    this is way to less information. if you use DataSources, note that conn.close() does not close the connection but just informs the DataPool that this connection is not needed anymore so that it can be reused.

  • Database connection timeouts and datasource errors

    Connections in the pool randomly die overnight. Stack traces show that for some reason, the evermind driver is being used even though the MySql connection pool is specified.
    Also, the evermind connection pool is saying connections aren't being closed, and the stack trace shows they're being allocated by entity beans that are definitely not left hanging around.
    Sometimes we get non-serializable errors when trying to retrieve the datasource (this is only after the other errors start). Some connections returned from the pool are still good, so the application limps along.
    EJBs and DAOs both use jdbc/SQLServerDSCore.
    Has anyone seen this problem?
    <data-sources>
         <data-source
              class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"
              name="SQLServerDSCore"
              location="jdbc/SQLServerDSCore"
              xa-location="jdbc/xa/SQLServerXACore"
              ejb-location="jdbc/SQLServerDSCore"
              connection-driver="com.mysql.jdbc.Driver"
              min-connections="5"
              username="xxx"
              password="xxx"
              staleness-timeout="3600"
              alive-poll-query="SELECT 1 FROM medispan"
              url="jdbc:mysql://1.2.3.4:3306/dbo?autoReconnect=true&autoReconnectForPools=true&cachePrepStmts=true&is-connection-validation-required=true"
              inactivity-timeout="30"
         >
              <property name="autoReconnect" value="true"/>
              <property name="autoReconnectForPools" value="true"/>
              <property name="is-connection-validation-required" value="true"/>
              <property name="cachePrepStmts" value="true"/>
         </data-source>
    </data-sources>

    Rick,
    OC4J 9.0.4.0.0 - BTW, do you know of any patches?As far as I know, there are no patches for the 9.0.4
    production version of OC4J stand-alone.
    I'm using container managed persistence,It was not clear to me, from your previous post, that you
    are using CMP entity beans.
    I found staleness-timeout and alive-poll-query
    somewhere on a website when trying to track this
    down. Here's four sources:Those sources refer to OrionServer -- and an older version, too, it seems.
    Like all other Oracle products that start out as somebody
    else's -- including, for example, JBuilder (that became "JDeveloper"), Apache Web Server (that became "Oracle HTTP Server") and TopLink -- their development paths diverge, until, eventually, there is absolutely no similarity between them at all. Hence, the latest versions of OC4J and "OrionServer" are so different, that you cannot be sure that something that works for "OrionServer" will work for OC4J.
    I recall reading something, somewhere, sometime about configuring OC4J to use different databases (other than Oracle), but I really don't remember any details (since it was not relevant to me, because we only use Oracle database). In any case, it is possible to use a non-Oracle database with OC4J.
    Good Luck,
    Avi.

  • Another hard drive swap question - re: 8GB partition for OSX in iMac 266

    I have a Tangerine iMac 266 that I am setting up for a neighbor's son. The original 6GB hard drive was toast, so I swapped in an old 10GB drive that had previously been removed from an iMacDV 400. The 10GB "new" drive had OSX 10.3.1 and OS 9.1 on a single partition. I am aware that these early iMacs need OSX in a first partition of less than 8GB, so I expected that I would need to partition the "new" drive. However, while I was loading an install CD after powering up, the iMac booted fine into OSX, despite it NOT being located in a first partition of less than 8GB (and has continued operating well - booting multiple times in OS X and 9, surfing the net, etc...the only weirdness is a refusal of Word X to run).
    I thought this was impossible, and in researching this I found that the Apple support site says that, for this computer, "Mac OS X must be installed on a volume that is contained entirely within the first 8 GB of its ATA hard disk." see http://docs.info.apple.com/article.html?artnum=106235
    My Questions:
    Is the 8GB limit only related to iINSTALLING OSX on these machines (and not RUNNING OSX)?
    Will the machine run into problems later if a portion of the OS (i.e., during an update) gets installed outside of the first 8GB of the disk?
    One of the log files says that the driver is out of date for the RageproC, and Classic applications that require more than 4MB of VRAM say that I don't have enough VRAM to run, yet the iMac has 6MB of VRAM (2 on MB and 4 in slot as listing by the system profiler) - do I need to (or should I) reinstall the system software (I already tried loading the latest ATI drivers, but it did't help)?
    P.S. - to add more data points on the subject of RAM upgrades in these iMacs, my iMac 266 would not accept a 256MB PC-100 SO-DIMM that worked fine in an iBook and in the upper slot of a Rev. A iMac 233. Well, it accepted it, but only recognized the first 128MB.

    I believe Duane is correct. Even with Mac OS 9, you can run fine as long as all OS components used during startup are within the first 8GB of space. However, (even with Mac OS 9) as soon as something used during startup ends up beyond that limit, you will get open firmware or a gray screen at startup. The Mac OS X does not allow the installation target to exceed the limit as a preventative measure, not because it won't work at all.
    The best "non-technical" explanation I have heard as to why, is this... The IDE hardware (and its driver) can only "see" the first 8GB of space during the initial start up process before the OS is loaded. Once start up completes, control is handed to the OS, which can see the entire drive. Therefore, apps have no problem running from beyond the limit. Only components needed before the hand-off is constrained to the 8GB limit.
    FYI - On my iMac and 120GB drive, 7.78 GB (as shown in a Finder window) is the precise point where the Mac OS X Installer allows the volume to be the install target. "Precise" to with a few hundred MB's.

  • Possible to change the datasource from a business-view to a Sql Command ?

    Hello,
    When a business view contains a lot of elements it takes a while just to open the report.
    We'd like to keep the BV as the dictionnary, but,
    once the report design completed,
    we'd like to disconnect the business view and replace it by the Sql command which can be seen in the menu option 'show SQL query'.
    Is it possible via the RAS sdk ?
    Did somebody experience this ?
    How to proceed ?
    Thanks a lot
    Alain

    Hi Ted,
    I'm thinking opening a Case for this problem of opening reports based on a big BV.
    We can't really reduce the BV, since it is the dictionnary and we need the whole thing...
    I'm wondering why it is impossible to change the Datasource if the tables and fields underneath are identical.
    Is it impossible to change the fields' mapping ?
    The other solution, as you suggest, is to create a report from scratch, create a new Datasource with the Sql command format, and rebuild the report... I agree it looks like a big job...
    Do you know if it is possible to export the report in XML for instance, change the XML, and then re-import ?
    Thanks for your Help.
    Alain

Maybe you are looking for

  • Hi, can I install windows XP with bootcamp on my iMac which is now on Maverick? Please help.

    Hello all, can I install windows XP with bootcamp on my iMac which is now on Maverick? Please advise. Thank you.

  • How to use TIMS type KF

    Dear all     Check in RSD1 the TIMS type KF is stored as char 6,     but in library , it is said stored as char 8.     Now i can see the value in the kf in cube: 04:00:00     but display at query as: 64200.00     Any guidance is greatly appreciated!

  • Grouping two sections in one report

    Hello, I am newbie to Crystal Reports.I have one doubt in designing a report. The proto for the report is: Date: XX:XX:XXXX                                 Sales Report - Value S No     Item         Increase    Decrease 1           XXX 2           YY

  • How to get the system name of the client?

    Hi, I 've followed this Blog: https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/getting%252blogged%252bin%252bportal%252buser%252bdetails%252bin%252bweb%252bdynpro getSAPUser() method returns the logged in user name. Is it possible to get t

  • Usage of Transaction IView in WPC

    Hi Experts, Can we use the Transaction IView in WPC(WEBPAGE COMPOSER 7.0) ? Thanks in advance Suresh