JPA with MySQL-Data-Source

Hello Forum,
I have a question regarding usage of a MySQL-Data-Source in combination with JPA
on the SAP NetWeaver Application Server, Java ™ EE 5 Edition.
I have setup a custom datasource like explained in paper:
"Working with Database Tables, DataSources and JMS Resources"
- registered the database driver via telnet (Using mysql-connector-java-5.0.3-bin.jar)
- created the data-sources.xml file underneath the META-INF dir of the EAR project
[code]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data-sources SYSTEM "data-sources.dtd" >
<data-sources>
  <data-source>
    <data-source-name>titan_cruises_ds</data-source-name>
    <driver-name>mysql-connector-java-5.0.3-bin.jar</driver-name>
     <init-connections>1</init-connections>
     <max-connections>10</max-connections>
     <max-time-to-wait-connection>60</max-time-to-wait-connection>
     <expiration-control>
          <connection-lifetime>600</connection-lifetime>
          <run-cleanup-thread>60</run-cleanup-thread>
     </expiration-control>
     <sql-engine>native_sql</sql-engine>
    <jdbc-1.x>
      <driver-class-name>com.mysql.jdbc.Driver</driver-class-name>
      <url>jdbc:mysql://ourHost.internal.com:3306/practise_titan_cruises</url>
      <user-name>myUser</user-name>
      <password>myPass</password>
    </jdbc-1.x>
  </data-source>
</data-sources>
[/code]
After that I manually created the persistence.xml underneath the META-INF dir of the EJB project.
[code]
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
     <persistence-unit name="titan_cruises_pu">
          <jta-data-source>titan_cruises_ds</jta-data-source>
     </persistence-unit>
</persistence>
[/code]
After that I created the Entity named "Cabin" and the corresponding table within the db.
Entity code:
[code]
package de.collogia.beans.pojo.ship;
import java.io.IOException;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
This persisted POJO class models the cabin data.
<p>
In this class persistence annotations are placed on the getter methods
of the attributes. This tells the persistence manager to access them
via the corresponding get- and set-Methods.</p>
(Unfortunately this does not work on NetWeaver and I had to place them
on field level aggain...)
@author Henning Malzahn ([email protected])
svn-revision:         $Rev:: 670                                           $:
svn-lasted-edited-by: $Author:: henning                                    $:
svn-last-changed:     $Date:: 2007-02-21 21:49:51 +0100 (Wed, 21 Feb 2007) $:
@Entity
@Table(name = "cabin")
public class Cabin implements Serializable {
    /** The generated serial version UID used for serialization. */
    private static final long serialVersionUID = -8522497314498903378L;
    /** The actual version number of this class used for serialization. */
    private static int actualVersion = 1;
    /** The cabin's id. */
    @Id
    @GeneratedValue
    @Column(name = "id")
    private long id;
    /** The cabin's name */
    @Column(name = "name")
    private String name;
    /** The cabin's deck level */
    @Column(name = "deck_level")
    private int deckLevel;
    /** The cabin's ship id */
    @Column(name = "ship_id")
    private int shipId;
    /** The cabin's bed count */
    @Column(name="bed_count")
    private int bedCount;
/---- Serialization/ Deserialization methods -/
Method that is responsible for deserialization of the object.
@param in The <code>ObjectInputStream</code> object to read
          the data from.
@throws IOException That may occur when reading from the
                    <code>ObjectInputStream</code> object
@throws ClassNotFoundException That may occur when invoking the default
                               deserialization mechanism.
    private void readObject(final java.io.ObjectInputStream in)
        throws IOException, ClassNotFoundException {
        /* Invoke default deserialization mechanism. */
        in.defaultReadObject();
        /* Read the actual version number of the class. */
        actualVersion =  in.readInt();
    } // End of readObject()
Method that is responsible for serialization of the object.
@param out The <code>ObjectOutputStream</code> object to write
           the data to.
@throws IOException That may occur when writing to the
                    <code>ObjectOutputStream</code> object.
    private void writeObject(final java.io.ObjectOutputStream out)
        throws IOException {
        /* Invoke default serialization mechanism. */
        out.defaultWriteObject();
        /* Write the actual version number of the class. */
        out.writeInt(actualVersion);
    } // End of writeObject()
/---- Defining constructors -/
Private default constructor.
    private Cabin() {
    } // End of default constructor
Full constructor.
@param name The cabin's name.
@param deckLevel The cabin's deck level.
@param shipId The cabin's ship id.
@param bedCount The cabin's bed count.
    public Cabin(final String name,
                 final int deckLevel,
                 final int shipId,
                 final int bedCount) {
        this.name = name;
        this.deckLevel = deckLevel;
        this.shipId = shipId;
        this.bedCount = bedCount;
    } // End of full constructor
/---- Overridden class methods -/
Returns a string representation of the cabin's data.
@see java.lang.Object#toString()
    @Override
    public String toString() {
        StringBuffer strBuf = new StringBuffer();
        strBuf.append(this.name);
        strBuf.append("\n");
        strBuf.append(this.deckLevel);
        strBuf.append("\n");
        strBuf.append(this.shipId);
        strBuf.append("\n");
        strBuf.append(this.bedCount);
        return strBuf.toString();
    } // End of toString()
/---- Defining instance methods -/
Get method for the member "<code>id</code>".
@return Returns the id.
    public long getId() {
        return this.id;
Set method for the member "<code>id</code>".
HTDODO hm: Check whether it is possible to have setId method
using private accesss level with NetWeaver JPA-Provider!
@param id The id to set.
    private void setId(final long id) {
        this.id = id;
Get method for the member "<code>name</code>".
@return Returns the name.
    public String getName() {
        return this.name;
Set method for the member "<code>name</code>".
@param name The name to set.
    public void setName(final String name) {
        this.name = name;
Get method for the member "<code>deckLevel</code>".
@return Returns the deckLevel.
    public int getDeckLevel() {
        return this.deckLevel;
Set method for the member "<code>deckLevel</code>".
@param deckLevel The deckLevel to set.
    public void setDeckLevel(final int deckLevel) {
        this.deckLevel = deckLevel;
Get method for the member "<code>shipId</code>".
@return Returns the shipId.
    public int getShipId() {
        return this.shipId;
Set method for the member "<code>shipId</code>".
@param shipId The shipId to set.
    public void setShipId(final int shipId) {
        this.shipId = shipId;
Get method for the member "<code>bedCount</code>".
@return Returns the bedCount.
    public int getBedCount() {
        return this.bedCount;
Set method for the member "<code>bedCount</code>".
@param bedCount The bedCount to set.
    public void setBedCount(final int bedCount) {
        this.bedCount = bedCount;
} // End of class Cabin
[/code]
After that I created the TravelAgentBean, a Stateless Session Bean, implementing
a remote interface that allows construction and persisting of new Cabin objects:
[code]
package de.collogia.beans.session.stateless;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import de.collogia.beans.pojo.ship.Cabin;
Class that implements the <code>TravelAgentRemote</code> interface
and defines the business methods of the TravelAgent service.
@author Henning Malzahn ([email protected])
svn-revision:         $Rev:: 670                                           $:
svn-lasted-edited-by: $Author:: henning                                    $:
svn-last-changed:     $Date:: 2007-02-21 21:49:51 +0100 (Wed, 21 Feb 2007) $:
@Stateless
public class TravelAgentBean implements TravelAgentRemote {
    /** The <code>Log</code> object for this class. */
//    private static final Log LOGGER;
    /** The <code>PersistenceManager</code> object. */
    @PersistenceContext(unitName = "titan_cruises_pu")
    EntityManager em;
/---- Static initializer -/
//    static {
//        LOGGER = LogFactory.getLog(TravelAgentBean.class);
//    } // End of static initializer block
/---- Implementing remote interface methods -/
{@inheritDoc}
    public void createCabin(final Cabin cabin) {
        this.em.persist(cabin);
    } // End of createCabin()
} // End of class TravelAgentBean
[/code]
After that I created a Controller class containing a main method that looks up the remote
interface of the TravelAgentBena like explained in document "Accessing Enterprise JavaBeans Using JNDI
in SAP NetWeaver Application Server, Java ™ EE 5 Edition" written by Validimir Pavlov of SAP NetWeaver
development team.
Unfortunately I receive an Exception after invoking the createCabin(...) method.
On the console of the NWDS I receive:
[code]
javax.ejb.EJBException: Exception in getMethodReady() for stateless bean sap.com/test2Earannotation|test2Ejb.jarannotation|TravelAgentBean;
nested exception is: com.sap.engine.services.ejb3.util.pool.PoolException: javax.ejb.EJBException: Cannot perform injection over bean instance
Caused by: java.lang.RuntimeException: The persistence unit is inconsistent:
The entity >>de.collogia.beans.pojo.ship.Cabin<< is mapped to the table >>cabin<<, which does not exist.
[/code]
But if I look at the log file located in "C:\NWAS_JAVAEE5\JP1\JC00\j2ee\cluster\server0\log\defaultTrace.0.trc"
I see the real reason is:
[code]
[EXCEPTION]
#6#1064#42000#You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax
to use near '"cabin"' at line 1#collnx02.collogia.de:3306:null:practise_titan_cruises#select * from "cabin"#com.mysql.jdbc.exceptions.MySQLSyntaxErrorException:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"cabin"' at line 1
     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
     at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
     at com.mysql.jdbc.Connection.execSQL(Connection.java:3124)
     at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1149)
     at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1262)
     at com.sap.sql.jdbc.basic.BasicPreparedStatement.executeQuery(BasicPreparedStatement.java:99)
     at com.sap.sql.jdbc.direct.DirectPreparedStatement.executeQuery(DirectPreparedStatement.java:307)
     at com.sap.sql.jdbc.direct.DirectPreparedStatement.executeQuery(DirectPreparedStatement.java:264)
     at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.executeQuery(PreparedStatementWrapper.java:274)
[/code]
My goodness - what a long post - sorry for this - I hope I provided all information
necessary to deal with the issue.
Am I thinking in the right direction to blame attribute [code]<sql-engine>native_sql</sql-engine>[/code]
of file data-sources.xml for the beaviour? Are there any other argument options than native_sql?
Thanks in Advance!
Henning Malzahn

Hi Henning,
> Despite the fact it's working now I have to do some
> changes to my code currently
> developed using JBoss/ Hibernate combination.
> Hibernate allows you to have the
> default no-arg constructor with private visibility -
> any special reason for the fact that
> only protected is allowed on NetWeaver?
Here we strictly implemented the checks according to the requirements of the JPA specification. Technically, we could do with private constructors as well. But the JPA specifications requires the constructor to be protected to allow a JPA implementation to subclass entities if needed.
> The entities in the project are final classes
> so declaring a ctor protected doesn't really make
> sense...
For the same reason, your entities should not be final. Are we missing a check here ?
> Also the persistence.xml parameter
>
hibernate.hbm2ddl.auto
with the value of
> create-drop is very useful while
> developing the app - everytime you deploy the project
> you get a fresh database.
> Is there a comparable option for NetWeaver?
No, unfortunately, there is no comparable option in SAP JPA (yet). We understand that there is a need for forward mapping. We would have liked to delegate this task to the JPA design time (i.e. Dali). However, we had to discover that Dali does not perform this task properly and we can't recommend using it any more.
Consequently, there is no automatic schema generation in SAP JPA 1.0.
>
> Another thing is the extra TMP_SEQUENCE table which
> isn't necessary using JBoss and
> Hibernate - what's the reason for that?
With Hibernate Entity Manager, the id generation strategy in use with GenerationType.AUTO depends on the database dialect. This means that depending on the database dialect, IDENTITY columns, SEQUENCES or generator tables (TableHiLo) are required. As Hibernate has the before mentioned schema generation property this fact can be hidden to the user.
In SAP JPA, we are always using a table generator if GenerationType.AUTO is used. This allows for better portability across databases. It requires the table TMP_SEQUENCE. As we unfortunately do not have a schema generation capability, the user must create this table.
Best regards,
Adrian

Similar Messages

  • MySQL Data Source causes a "Failed to Generate Wrapper Class" error

    Hi all, I've created a MySQL datasource but when I make it the source for a EJB
    I get the error above. I think the error occurs during deployment, rather than
    while building. It seems to be having problems with the Data Source URL but I've
    checked the syntax and it all seems OK. When I use a WebLogic-supplied, PointBase
    datasource the deployment works OK, so it must be the way I've configured/built
    my datasource. Any areas I should check before I go further? I'm using 8.1 evaluation
    version. Thanks in advance, Roy.

    Thanks Flip, I tried your suggestion but I still get the same error. One bizarre
    thing is that if I use the"com/mysql/jdbc/Driver", I get a ClassDefinfitionNotFound
    error when installing the connection pool, but no such problem if use the traditional
    "org/gjt/mm/mysql/Driver". Using this I can at least create a data source but
    the class wrapper error is still there. Any more suggestions, anyone?
    "Flip" <[remove][email protected]> wrote:
    You'll have to go looking for the POINTBASE_HOME, POINTBASE_TOOL and
    POINTBASE_CLASSPATH. For me (running RH90), it's in my bea
    /weblogic81/common/bin/commEnv.sh. After you comment out those lines,
    you'll have to place your MySQL jar someplace. I'm not sure where's
    the
    recommended place (I've put mine into a /classes folder under my domains
    before) and then somewhere reference explicitly the MySQL jar file in
    the
    classpath.
    Then WLS will be able to find your MySQL drivers and your DS should fire
    up
    just great. Good luck.
    "Stephen Felts" <[email protected]> wrote in message
    news:[email protected]...
    1. Try moving mysql.jar out of jre\lib\ext.
    2. set PRE_CLASSPATH=directory\mysql.jar
    This is used in startWLS.cmd (take a quick look).
    "Roy Crosland" <[email protected]> wrote in message
    news:[email protected]...
    Thanks Stephen, but can you tell how I place the jar in the classpath?
    At
    the moment
    I have the line: "set
    CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\server\lib\weblogic_sp.jar;%WL
    >
    _HOME%\server\lib\weblogic.jar;%JAVA_HOME%\jre\lib\ext\mysql.jar;%CLASSPATH%
    in the startWLS.CMD file. Should I refer to the mysql.jar elsewhere?
    and
    is the
    jar file itself in the correct directory?
    "Stephen Felts" <[email protected]> wrote:
    You need to have the mysql jar in the server classpath.
    It needs to be before the Pointbase jar(s).
    "Roy Crosland" <[email protected]> wrote in message
    news:[email protected]...
    Hi all, I've created a MySQL datasource but when I make it the
    source
    for
    a EJB
    I get the error above. I think the error occurs during deployment,rather
    than
    while building. It seems to be having problems with the Data SourceURL
    but I've
    checked the syntax and it all seems OK. When I use a
    WebLogic-supplied,
    PointBase
    datasource the deployment works OK, so it must be the way I'veconfigured/built
    my datasource. Any areas I should check before I go further?
    I'm
    using
    8.1 evaluation
    version. Thanks in advance, Roy.

  • 11i EBS XML Publisher Report with Multiple Data Source

    I need to create XML Publisher report in 11i EBS pulling data from another 10.7 EBS Instance as well as 11i EBS in single report.
    I am not allowed to create extract or use db links.
    My problem is how to create Data Source Connection using Java Concurrent Program.
    The approach I am trying is
    1. create Java concurrent program to establish connection to 10.7 instance.
    2. Will write the SQL queries in Data Tempalete with 2 Data Source 1 for 11i EBS and 2 for 10.7 EBS
    3. Template will show the data from both query in 1 report..
    Is there any other way to proceed using datasource API...
    thanks

    option1:
    The query should be same @ detail level, only the template has to be different for summary and details.
    @runtime, user can choose to see the detail/summary
    Disadvantage, if the data is huge,
    advantage , only one report.
    option2:
    create two separate reports summary and details
    and create diff data and diff layout and keep it as different report
    Advantage, query will perform based on the user run report, summary/detail, so that you can write efficient query.
    Dis advantage , two reports query/template to be maintained.

  • 64bit CR-Enterprise wont talk with 32bit data source, 32bit IDT wont use 64bit connection for universe. How do I connect them.

    Hi.
    I installed the full suite of tools as I am involved with a company intended to become a partner and reseller so we are trying to get everything working.
    SAP Crystal Server 2013 SP1
    BusinessObjects Business Intelligence platform
    SAP Crystal Reports for Enterprise
    SAP HANA
    SAP Crystal Reports 2013 SP1
    SAP BusinessObjects Explorer
    SAP Crystal Dashboard Design 2013 SP1
    Crystal Server 2013 SP1 Client Tools
    SAP BusinessObjects Live Office 4.1 SP1
    .NET SDK
    I found out that BI was needed only after I installed all the others but I installed it without problem.
    My issue is that the Information Design Tool (IDT) which creates my universes successfully, and even lets me open and see the dada no problem. Is using a 32bit (ODBC connected to SQL Server 2008) data source.
    However, I am unable to load the .UNX in crystal reports (CR) 2011, so I used CR Enterprise (CRE) to connect to my universe. Now when I try to open the universe I start getting the following error:
    [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
    When I do searches online I get very generic information relating to setting up data sources. While I believe the problem is indeed with the data source, I don't believe it is setup wrong.
    When I access the universe using the IDT (which uses the 32bit version of the data source to build its connection, it wont let me use a 64bit) I can load a table under the "result objects for query #1" press refresh, I get a list of data.
    When I access the same universe using CRE (which "Seems" to use a 64bit data source, but I am not sure), and follow the same process as above. I get the above error.
    If I cancel the process, when CRE lists the fields for the report I can later manually map these fields to an ODBC connection. But if I have to do this what is the point of using the universes at all as the end user has full access to all the various DB's available in the data source.
    Thanks in advance for any help you can provide.

    On the server where Crystal Reports Server is installed, create a 64-bit ODBC connection with the same name as the 32-bit connection.  CRS will then automatically use the 64-bit version of the connection.
    -Dell

  • CrystalReports error in XI 3.1 with Oracle Data Source

    Having trouble running Crystal Reports with Oracle data source off XI 3.1 SP3. Reports hang through CMC or InfoView. Have no trouble on identical environment (presumably) with the same reports. Basically this happened after migration.
    Report can be run on designer on the server box (suggesting the connection is good) however once uploaded to CMS, it hangs with error. This is not about an specific report only reports with Oracle Data source (Oracle client already installed and connection established)
    Any comments appreciated.

    Thank you for your reply.
    Seems like a re-boot resolved the problem.
    Edited by: Amir Eskandari on Feb 10, 2011 3:57 PM

  • XmlDataProvider .... is gone completely in my Xaml file. Why? How many different ways to deal with xml data source through WPF

    I followed a procedure described in a book.
    1. insert "Inventory.xml" file to a project "WpfXmlDataBinding" .
    2. add the XML data source through the data panel of "blend for 2013", named it "InventoryXmlDataStore" and store it in the current document.
    3. dragged and droppped the nodes from the Data panel onto the artboard.
    Then I checked my Xaml file against the one provided by the book
    Xaml file by the book:
    <Window.Resources>
    <!-- This part is missing in my xaml file --><XmlDataProvider x:Key="InventoryDataSource"
    Source="\Inventory.xml"
    d:IsDataSource="True"/>
    <!-- This part is missing in my xaml file -->
    <DataTemplate x:Key="ProductTemplate">
    <StackPanel>
    <TextBlock Text="{Binding XPath=@ProductID}"/>
    <TextBlock Text="{Binding XPath=Cost}"/>
    <TextBlock Text="{Binding XPath=Description}"/>
    <CheckBox IsChecked="{Binding XPath=HotItem}"/>
    <TextBlock Text="{Binding XPath=Name}"/>
    </StackPanel>
    </DataTemplate>
    </Window.Resources>
    <Grid>
    <ListBox HorizontalAlignment="Left"
    ItemTemplate="{DynamicResource ProductTemplate}"
    ItemsSource="{Binding XPath=/Inventory/Product}"
    Margin="89,65,0,77" Width="200"/>
    </Grid>
    my Xaml file:
    <Window x:Class="WpfXmlDataBinding.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="922" Width="874">
    <Window.Resources>
    <DataTemplate x:Key="ProductTemplate">
    <StackPanel>
    <TextBlock Text="{Binding XPath=@ProductID}"/>
    <TextBlock Text="{Binding XPath=Cost}"/>
    <TextBlock Text="{Binding XPath=Description}"/>
    <CheckBox IsChecked="{Binding XPath=HotItem}"/>
    <TextBlock Text="{Binding XPath=Name}"/>
    </StackPanel>
    </DataTemplate>
    </Window.Resources>
    <Grid DataContext="{Binding Source={StaticResource InventoryXmlDataStore}}">
    <ListBox HorizontalAlignment="Left" Height="370"
    ItemTemplate="{DynamicResource ProductTemplate}"
    ItemsSource="{Binding XPath=/Inventory/Product}"
    Margin="65,55,0,0" VerticalAlignment="Top" Width="270"/>     
        </Grid>
    </Window>
    All looks quite the same except the <XmlDataProvider ....> part under <Window.Resources>, which is gone completely in my Xaml file.
    1, Why?
    2, How many different ways to deal with xml data source through WPF?
    Thanks, guys.
    (ps My "WpfXmlDataBinding" runs without problem through.)

    Never do yourself down Richard.
    Leave that to other people.
    It's quite common for smart developers to think they're not as good as they are.
    I coach a fair bit and it's a surprisingly common feeling.
    And to repeat.
    Never use anything ends .. provider.  They're for trivial demo apps.  Transform xml into objects and use them.  Write it back as xml.  Preferably, use a database.
    You want to read a little mvvm theory first.
    http://en.wikipedia.org/wiki/Model_View_ViewModel
    Whatever you do, don't read Josh Smiths explanation.  I used to recommend it but it confuses the heck out newbies. Leave that until later.
    Laurent Bugnion did a great presentation at mix10.  Unfortunately that doesn't seem to be working on the MS site, but I have a copy.  Download and watch:
    http://1drv.ms/1IYxl3z
    I'm writing an article at the moment which is aimed at beginners.
    http://social.technet.microsoft.com/wiki/contents/articles/30564.wpf-uneventful-mvvm.aspx
    The sample is just a collection of techniques really.
    I have a sample which involves no real data but is intended to illustrate some aspects of how viewmodels "do stuff" and how you use datatemplates to generate UI.
    I can't remember if I recommended it previously to you:
    https://gallery.technet.microsoft.com/WPF-Dialler-simulator-d782db17
    And I have working samples which are aimed at illustrating line of business architecture.  This is an incomplete step by step series but I  think more than enough to chew on once you've done the previous stuff.
    http://social.technet.microsoft.com/wiki/contents/articles/28209.wpf-entity-framework-mvvm-walk-through-1.aspx
    The write up for step2 is work in progress.
    https://gallery.technet.microsoft.com/WPF-Entity-Framework-MVVM-78cdc204
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • Using MySQL data source in OWB

    Hi All,
    I need to use a MySQL data source in OWB. Could you please tell me the steps needed to define and configure the MySQL module in OWB?
    Thanks and Regards,
    Amit

    Directly in the source component, or in the expressions property of the data flow?
    If the latter, what happens when you preview your expression?
    MCSE SQL Server 2012 - Please mark posts as answered where appropriate.

  • Query for records on a block with Query Data Source Type : Procedure

    Hi All,
    The veriosn of form I'm using is:
    Forms [32 Bit] Version 6.0.8.23.2
    I have a block based on a procedure.
    But when I enetr-query and search for records specific to ceratin criteria even then the result of the Query is all records.
    Is Query not allowed on a block with Query Data Source Type : Procedure.
    Hope my question is clear.
    Thanks in advance.
    Regards
    Arif

    When you use a table based block, forms can construct any select with any where clause based on the given inputs. Using a procedure based block, forms cannot "know" which in or out parameter of the procedure corresponds to which item. Even if Forms could pass the value of an item to an argument automagically, the procedure would have to "do something" with the argument, and you´d have to code it.
    So, any item that should be used in the where-clause must be mapped to an argument.
    Perhaps it would be easier to use a table based block querying a view? For DDL, you could use an instead-of-trigger on the view.
    Regards,
    Gerd

  • Adhoc Query Requirement with Multiple Data Source

    Hi All,
    I have a Adhoc Query Requirement with Multiple Data Source. Is there any way to achive it. Other than Resultant set and bring into Model.
    Thanks
    SS

    You can compare stuff in the EL, but I don't think this is what you need.
    You can just use Java code in the backing bean class for all the business logic. You can use DAO classes for database access logic. Finally for displaying you can use the JSF tags such as h:outputText.

  • Using ConnBean and CursorBean with a Data Source

    Hi all,
    I',m making a web app. using the Jdev (RUP4) with OA Extension. I looked in the help menu under "About Data-Access JavaBeans and Tags". Here I found the following example, but for some stange reason I cannot get the setProperty to work.
    Example: Using ConnBean and CursorBean with a Data Source This following is a sample JSP page that uses ConnBean with a data source to open a connection, then uses CursorBean to execute a query.
    <%@ page import="java.sql.*, oracle.jsp.dbutil.*" %>
    <jsp:useBean id="cbean" class="oracle.jsp.dbutil.ConnBean" scope="session">
    <jsp:setProperty name="cbean" property="dataSource"
    value="<%=request.getParameter("datasource")%>"/>
    </jsp:useBean>
    <% try {
    cbean.connect();
    String sql="SELECT ename, sal FROM scott.emp ORDER BY ename";
    CursorBean cb = cbean.getCursorBean (CursorBean.PREP_STMT, sql);
    out.println(cb.getResultAsHTMLTable());
    cb.close();
    cbean.close();
    } catch (SQLException e) {
    out.println("<P>" + "There was an error doing the query:");
    out.println("<PRE>" + e + "</PRE>\n<P>"); }
    %>
    Does anyone know how to set the "Property" to a datasource and make it work?
    Best regards,
    MHCI

    There is no point-and-click (Import Data Source Metadata) way to use an LDAP server as a datasource. You have to use the Java Function provided on dev2dev. If you need help with it, please post here.
    - Mike

  • DATACOPY with partitioned data source

    Hello,
    I am actually working on the Hyperion Essbase EPM 11.1.2
    I am trying to perform a Datacopy command in a HBR.
    Data source are partitioned with a transparent partition.
    This datacopy do not work. The HBR is really fast but when I retrieve data no data are copied.
    I am wondering if this is possible to perform a datacopy command, in a HBR with partitioned data source.
    I have managed to perform this datacopy throw a HBR using the command:
    SET CREATEBLOCKONEQ
    Target = Source;
    But this method is really long.
    Thanks for your answer,
    Arthur.

    Hi
    Make sure that you have relevant Role & Authorization at Quality/PRS.
    You have to Transport the Source Cube first and then Create a Generate Export Data Source in QAS. Then, replicate data sources for BW QAS Soruce System. Make sure this replicated Data Source in QAS. Only then can transport new update rules for second cube.
    Hope it helps and clear

  • Obiee with unstructured data source

    Hi,
    How to work with Unstructured data sources using OBIEE 11g?Anybody any idea?examples would really help.
    Is it also available in 10g also?
    Please Help.
    Regards,
    Krish

    Hi Krish,
    It's actually possible to use OBIEE with unstructured data.
    Even if you don't have real FK relations in your database and a proper model, OBIEE can create queries if you tell him where to find the joins and how they are defined.
    The Idea is to create you FK in the physical layer and try to have a 3FN schema (star schema with Dimension and Fact) as much as possbile in your Business layer.
    A very nice presentation is available on Mark Rittman webite:
    http://www.rittmanmead.com/files/3_Complex_Modeling_with_OBIEE_Elio_Idema.pdf
    Hope it will help you to start.
    Regards
    PS: Please don't forget to close the thread and assign points when your question is answerd

  • Error in viewing data in a data template with multiple data sources

    Hello,
    I have designed a data template with two data sources.One is from DEPARTMENTS table and the other datasource is a xml file.Following is the code for the data template :
    <dataTemplate name="EmployeeListing" dataSourceRef="demo">
    <parameters>
    <parameter name="p_DEPTNO" dataType="character" defaultValue="20"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[SELECT DEPARTMENT_NAME,DEPARTMENT_ID,LOC from DEPARTMENTS]]>
    </sqlStatement>
    <xml name="empxml" expressionPath=".//ROW[DEPARTMENT_NAME =$DEPARTMENT_NAME]">
    <url method="GET" realm="" username="" password="">file:///D:\OraHome_1\xmlp\XMLP\DemoFiles\Employee Salary Report.xml</url>
    </xml>
    /dataQuery>
    </dataTemplate>
    The problem is when i am trying to view the data, only data from SQL Query Q1 is getting displayed and the data from Employee xml is not at all getting displayed.
    Could anyone please let me know what i am missing?
    Thanks
    Nutan
    Edited by: user609971 on Oct 23, 2008 8:06 AM

    This is from Documenation sample....
    Did you see the data structure section, where you say, how you wanted the columns ?
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    <dataTemplate name="Employee Listing" description="List of Employees" v
    ersion="1.0">
    <parameters>- Defines a single parameter for the Department Number
    - with default of 20:
    <parameter name="p_DEPTNO" dataType="character"
    defaultValue="20"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[SELECT DEPTNO,DNAME,LOC from dept
                      order by deptno]]>
    </sqlStatement>
    <xml name="empxml" expressionPath=".//ROW[DEPTNO=$DEPTNO]"> - Defines name
    - and link to DEPTNO in Q1
    <url method="GET" realm="" username="" password="">
    file:///d:/dttest/employee.xml</url> - Defines url for xml data
    </xml>
    </dataQuery>-
    <dataStructure>- The following section specifies the XML hierarchy
    - for the returning data:
    <group name="G_DEPT" source="Q1"
    <element name="DEPT_NUMBER" value="DEPTNO" />
    <element name="DEPT_NAME" value="DNAME"/>
    - This creates a summary total at the department level based
    - on the salaries at the employee level for each department:      
    <element name="DEPTSAL" value="G_EMP.SALARY"
    function="SUM()"/>
              <element name="LOCATION" value="LOC" />
    <group name="G_EMP" source="empxml">
    <element name="EMPLOYEE_NUMBER" value="EMPNO" />
    <element name="NAME" value="ENAME"/>
    <element name="JOB" value="JOB" />
    <element name="MANAGER" value="MGR"/>
    <element name= "HIREDATE" value="HIREDATE"/>
    <element name="SALARY" value="SAL"/>
    </group>     
    </group>
    </dataStructure>
    </dataTemplate>

  • Issue with 2LIS_02_SCL Data source

    Hi Everybody,
    I am facing the below 2 issues with 2lis_02_scl data source,
    1) This is fetching only the records  ETENR (Delivery Schedule Line Counter) value with ' 1 ', It is ignoring others ex:2,3 and 4. Hence Data is not reconciling with ECC system.
    2) The standard field GLMNG is not getting any data, Data was existed in table(EKET) level. So i have written the code and data is coming now. But the problem is, This is not considering the ROCANCEL indicator it seems. All the other key figures values are coming in with Negative sign When ROCANCEL Value is ' X ' or ' R ', But this field is getting all the positive values irrespective of ROCANCEL indicator. Hence showing the incorrect values compared to the ECC.
    Can anybody help me on this,
    Regards,
    Gopinath

    Hi Gopinath:
       Have you already applied any SAP Note to solve this problem?
    Please check if the SAP Note below is applicable to your system.
    668177 - "LIS BW: wrong quantity for documents with invoice plan"
    Regards,
    Francisco Milán.

  • SPM : Integration with External Data Sources

    Dear Experts,
    Can you let me know with your comments or by sharing any link or documentation, as to how to Integrate SPM with External Data Sources.
    And how many or what all external Data Sources, can SPM Connect with ?
    Regards
    Pankaj

    Hi Pankaj,
    There are no limitations of external data you can bring into BW and visualise in the SPM UI - you can expose custom bex queries as "datasources" in the user interface, and these can show anything you like. Its just a question about what makes sense to show in SPM.
    Are you looking to bring in anything specific?
    Thanks
    Neil

Maybe you are looking for