Obtaining DataSource from Application Module
How may i obtain DataSource from pool managed by Application Module? I want some of my db-related operation performed by Spring's JdbcOperations class ( http://www.springframework.org/docs/api/org/springframework/jdbc/core/JdbcOperations.html ) and i want have only one connection pool in my application.
Thanks,
Kind regards,
Marcin Zduniak / http://J2ME.pl
Refer
http://www.oracle.com/technology/products/jdev/howtos/10g/usingdatasources/using_datasources.html
Similar Messages
-
How to create a generic datasource from function module?
Dear experts,
I have created a generic datasource from function module. For this extrator, I created a function module and a structure.
I have now some difficulties to continue:
In this function module, i get data from different transparent tables. Then i put these data into an internal table.
I just don't know what is the relatioin between the structure i defined and this internal table.
I should make "iTab structure AA" in the source code?
ThanksHi..
check this
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
Generic Extraction via Function Module
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
1. Create s structure with the fields that you need from the 4 tables . Activate.
2. Goto SE 80 Select The Function Group , Copy , Select the Function module
" RSAX_BIW_GET_DATA_SIMPLE " and Give a New name starting With
Y or Z .
3. SE37 ->Your Function module name -> Change , In table tab give your structure
name by deleting the associated type given in " XXXX " .
4. Now select source code and Do the coding . Give Data source name in Coding .
In your case you have to take data from more that 1 table .
5. Activate the Function Group .
6. In RSO2 Create the Data source , Give the Function Module Name , And Save.
7. RSA3 -> Give data source name and Check for the Records .
Creation of custom datasource. (Using function module)
.Create a function group .
. Structure ZTXXXX
Create function module (i.e. ZTESTXXX) .
. Create the data source using transaction (RSO2).
. If structure exists for the table parameter of your function module then ok else create a structure for the table parameter .
Test the datasource in R/3 using transaction RSA3.
Transfer the data source to BW System and replicate it in the BW-System.
Message was edited by:
shiv -
PL/SQL from Application Module instead of Using VO/EO - Violating Standard?
Hi,
I have seen product code which Use PL/SQL APIs for committing data (Creation of Records in Table) from Application Module. There is no BC4J (VO/EO) used in this data route.
Is there any coding standard (document) which says such cases are against Standards.I know there is one Standard saying PL/SQL Based VO is dicouraged in Oracle Apps.
Thanks
JosephVikram,
Performance depends on the way you are going to make use of pl/sql code. Suppose if you are using pl/sql just for final insert/update with other validations bound to it through a single call, that's fine. But in case you have other multiple calls to pl/sql blocks also for fetching data for display purpose, that's where standard VO's will be more efficient reducing the number of trip for pl/sql calls. So use it only when it is the last way and you need to handle multiple validations with complex data structure.
As for locking, yes, you might have to take care of locking handling scenario if such a situation happens. But again it depends on what's your business logic and how is your data being processed.
--Shiv -
Call VO method from application module
Hi Experts.
In my case I have created VO and inside implementation class custom method: filterResultsByGroup()
code:
public class VO_Business_AreaImpl extends ViewObjectImpl implements VO_Business_Area {
public VO_Business_AreaImpl() {
public void filterResultsByGroup() {
System.out.println("hello");
now... I would like to call filterResultsByGroup() method from Application Module Imp class:
code:
public class AppModuleImpl extends ApplicationModuleImpl implements AppModule {
public AppModuleImpl() {
public VO_Business_AreaImpl getVO_Business_Area1() {
return (VO_Business_AreaImpl)findViewObject("VO_Business_Area1");
public void RunGroupFilter(){
ViewObjectImpl bussinesArea;
bussinesArea = this.getVO_Business_Area1();
ViewCriteria vc = bussinesArea.getViewCriteria("filterResultsByGroup();");
bussinesArea.applyViewCriteria(vc);
bussinesArea.executeQuery();
but it doesn't work. Anyone knows how to call this method?
Best Regards.you code should be like
VO_Business_AreaImpl bussinesArea;
bussinesArea = this.getVO_Business_Area1();
bussinesArea.filterResultsByGroup(); -
Obtaining DataSource from a client application
Hi,
I am trying to use the connection pooling capability of DataSource, but my application is not running under any container, ie. servlet/ejb. How can i obtain DataSource object ? Do I need to use JNDI to do that ? If so, how can I use JNDI without any web container/ejb container ?
thanks for the helpYou simple run the JNDI registry in a separate process, then bind obejcts to it, which could be a datasource or whatever. Then you have other objects connect to the JNDI tree and lookup objects. It works the same, but you simply have to initiate the JNDI service manually.
-
Obteain connection object from application module
Hello
I am working with ADF 10g using BC4j , I am in application module implementation class, how can I obtain the java.sql.connection object used by my application module?to execute prepared statements follow
http://download-uk.oracle.com/docs/html/B25947_01/bcadvgen005.htm#sm0297
to access the SQL connection itself (for whatever reason)
Re: how to get connection from adf bc?
Frank -
Error While Calling a WebService from Application Module
Hi all
I have generated a Proxy from a web Service and i am trying to call the web service from an Application Module it is throwing me error
JBO-29000: Unexpected exception caught: oracle.classloader.util.AnnotatedNoClassDefFoundError, msg= Missing class: webservices.types.com.siebel.xml.order_interface.Orders Dependent class: java.lang.reflect.Array Loader: jre.bootstrap Code-Source: unknown Configuration: jre bootstrap
Missing class: webservices.types.com.siebel.xml.order_interface.Orders Dependent class: java.lang.reflect.Array Loader: jre.bootstrap Code-Source: unknown Configuration: jre bootstrap
IMy web Service is correct, as i have executed the client and it is working fine, but when i try to class the web service from an external class or from an application module it is throwing me this error. So any light on this issue will be very helpful
thanksHi,
did you registered the web service in the external service registration? The "DataAccessException:" is a hint to this issue.
best regards,
Rene -
Error while calling webservice from application module
Hi all
I have generated a Proxy from a web Service and i am trying to call the web service from an Application Module it is throwing me error
JBO-29000: Unexpected exception caught: oracle.classloader.util.AnnotatedNoClassDefFoundError, msg= Missing class: webservices.types.com.siebel.xml.order_interface.Orders Dependent class: java.lang.reflect.Array Loader: jre.bootstrap Code-Source: unknown Configuration: jre bootstrap
Missing class: webservices.types.com.siebel.xml.order_interface.Orders Dependent class: java.lang.reflect.Array Loader: jre.bootstrap Code-Source: unknown Configuration: jre bootstrap
My web Service is correct, as i have executed the client and it is working fine, but when i try to access the web service from an application module it is throwing me this error. So any light on this issue will be very helpful
thanksThis forum is for XML DB issues. XML DB is a feature of 9iR2 and later.You need t look in the XML Technology forum
-
How to get value in backing bean from application module
Hi all.. I'm new in jdeveloper and adf..
I need to use value from backing bean and use that value in application module.
But I don't know how to get it.
Do you a have any solution?suppose you have myMethod(String argumentName1,String argumentName2) in your Application Module
then to access a method binding from a managed bean, use the following code,
BindingContext bctx = BindingContext.getCurrent();
BindingContainer bindings = bctx.getCurrentBindingsEntry();
OperationBinding operationBinding =
bindings.getOperationBinding("name_of_method_binding");
//Here you can pass the parameters value to the AM method
operationBinding.getParamsMap().put("argumentName1",value1);
operationBinding.getParamsMap().put("argumentName2",value2);
//invoke method
operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
//check errors
List errors = operationBinding.getErrors();
//optional
Object methodReturnValue = operationBinding.getResult(); -
POJOs or EJBs for worker classes spawned from Application Module?
Hello,
I'm running JDev 11.1.2.3.0.
I need to create a couple of worker classes that will be instantiated from my Application Module. The first will invoke PL/SQL via createCallableStatement. The second sends a message to a jabber server.
In the Java EE world, I'd do this with stateless EJBs and use the @PreConstruct and @PostDestroy annotations to control the lifecycle.
What is the recommended approach with ADF when using Classes to make these calls from an Application Module? Should one use POJOs and rely on WebLogic to handle garbage collection, or should/can one use EJB 3.0 stateless session beans?
Many thanks.
Edited by: user576183 on May 11, 2013 9:24 AMStateless session beans is the recommended approach with ADF BC too.
http://docs.oracle.com/cd/E14571_01/web.1111/b31974/bcextservices.htm
http://technology.amis.nl/2013/01/20/adf-interaction-with-business-service-an-ongoing-discussion/ -
BC4J: How get Connection from Application Module
I've written a custom method for my Application Module for using by the client tier. In this method I call a JPUblisher created class, that accesses a PL/SQL procedure. For this JPublisher created class I need a connection context. The class calls DefaultContext.getDefaultContext() but that seems to be null.
How can I get the current Connection of the Application Module, so that I can create a DefaultContext?
Unfortunately Transaction has no getConnection method.
Thanks,
RobertWe don't make the Connection directly available because in some sense it's a rope on which you can hang yourself if you are not careful. Since BC4J AppModules are most often used from a pool, and you might be using connection pooling in addition to application module pooling, in general it is not safe to get hold of the raw JDBC connection and "hang onto it".
If you make careful use to always get the current JDBC connection before you use it, and not try to cache it, then you should be ok. Often, you can avoid the need to get the raw JDBC connection by calling getDBTransaction().createPreparedStatement(...) or the analogous createCallableStatement() or createStatement() that are also on the DBTransaction interface.
Here is a little function you can add to your application module impl class to retrieve the Connection:
private Connection getCurrentConnection() {
Statement st = null;
try {
st = getDBTransaction().createStatement(0);
return st.getConnection();
catch (SQLException s) {
s.printStackTrace();
return null;
finally {
if (st != null) try { st.close(); } catch (SQLException s2) {}
}It basically creates a (dummy) statement, gets the current connection from the statement, then closes the statement.
I tried using this in a custom method in an AppModuleImpl class that invoked a JPublisher-create package-wrapper class like this:
public void callStoredProc() {
try {
// Empservice is package wrapper class created by JPublisher
Empservice e = new Empservice(getCurrentConnection());
BigDecimal sal = e.lookupsalary(new BigDecimal(7369));
System.out.println(sal);
catch (SQLException s) {
s.printStackTrace();
}and it works for me. -
Connection object from application module
hi
i was wondering if there is someway to retrieve the Connection object from the application module. something like:
java.sql.Connection conn = appMod.getConn();
i'm using JDeveloper 9.0.3.4
Thanks in advanced
VitorTake a look at
http://radio.weblogs.com/0118231/2004/01/30.html#a232
Sascha -
How to execute SQL Instruction from Application Module
Hi people
I´d like to know how I can execute a SQL Instruction like "delete from user" from the Application Module ..prepareSession method...
I´m Using Jdev 10 with ADF Faces
thank youHello,
Code example:
@Override
protected void prepareSession ( Session session ) {
super.prepareSession( session );
setDebugOff();
private static final String DEBUGOFF = "begin IVA_UI_ALGEMEEN_PCK.SET_DEBUG_OFF; end;";
public boolean setDebugOff () {
boolean success = false;
PreparedStatement debugOffSP = null;
try {
debugOffSP = getDBTransaction().createPreparedStatement( DEBUGOFF, 0 );
success = debugOffSP.execute();
} catch ( Exception e ) {
success = false;
} finally {
if ( debugOffSP != null ) {
try {
debugOffSP.close();
} catch ( Exception e ) {
log.warning( e.getMessage() );
return success;
}-Anton -
Binding Methods Exposed From Application Module
Hi All,
I am using JDeveloper 11.0.2. I have a method exposed on the Application Module that when invoked, it creates a row. I exposed AppModADImpl as a client interface. After doing this, I am now able to see the method under data control section. On my page, I when to bindings and tried to create a bind to this method, I am able to see the method but the OPERATIONS list is disabled, because of this, I am unable to create the bind to the page.
The method I'm trying to bind is below
public Row createSystemTypes() {
ViewObjectImpl vo = getAdSystemTypes1();
Row row = vo.createRow();
vo.insertRow(row);
return row;
Because the Operations List if disabled, when I click OK, I get the Error "No Actiond defined for the selected Item"
I would appreciate help to know why Im unable to bind the method to the page.As the method has been added to the client interface of the application module, you have to select the application module in the dialog, not a view object. After selecting the application module (or the data control or root node) you should see all methods which are part of the client interface.
Still, I wold do like Joonas outlined: use drag and drop and if you don't like the button you get this way on the page, switch to source mode and remove it. This will keep hte generated binding in the page def. Removing the button in design view will remove both, button and binding.
Timo -
Getting JNDI name from application module configuration
How to programmatically get JNDI name of the data source, specified in the bc4j.xcfg, using application module object or oracle.jbo.client.Configuration, or whatever?
im sorry for interupting this thread. i have a question for Vinay. Actually im watching this thread bcoz i too have the same question.
Vinay, what imports is to be added for this.None, if you are using ADFbc.
The method is available in your ApplicationModuleImpl (i.e. the Java Impl for your AM).
Here's the 11.1.1.5 javadoc:
http://docs.oracle.com/cd/E24001_01/apirefs.1111/e10653/oracle/jbo/client/remote/ApplicationModuleImpl.html#getSession__
im using Jdev 11.1.1.5.0 the statement is : System.out.println("Data Source Name"+getSession().getEnvironment().get("JDBCDataSource"));
Its showing getSession() method not found.
Any help???Where did you write that statement? It should work in the AMImpl as the javadoc shows....
Maybe you are looking for
-
My Apple TV is no longer showing any of my purchased movies or TV shows
My Apple TV is not showing any of the movies or TV shows that I purchased. They used to be there under the "Purchased" section of movies and TV shows, but now the list is empty. How can I get them to show up again?
-
IMac takes ages to load videos and then watch once "buffetting" stops
I need help to speed up my iMac, and I am not sure which bit needs tweaking. If I try and open a video link from a webpage, the content takes too long to load before you can actually watch the clip. I have to pause the video to wait for the load to "
-
I am uanble to open or close firefox. I usually use firefox. When I updated or download something it disable firefox. Last change July 5, 2011. I have tried downloading it a gain but it states I have existing program that is open and won't let me run
-
I'm new in using JNI. When i compile the C program that invoke the JAVA program, everthing goes fine. I can obtain the the "exe" from the compilation. But when i run the "exe" file it display "can't create Java VM". Here is the part of the code in C
-
mouths go out of sync every movie we watch from our lap top to our TV via HDMI, is there something we can do??