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 help

You 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.

Similar Messages

  • 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

  • I want to access JMS Queue in websphere from a client application

    Hello all
    I tried to access a jms queue in the websphere from a client application
    my connection factory jndi name is : MyConn
    my queue name jndi name is : MyQueue
    and here is my code :
    Hashtable environment = new Hashtable();
    environment.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.ibm.websphere.naming.WsnInitialContextFactory");
    environment.put(Context.URL_PKG_PREFIXES, "com.ibm.ws.naming");
    environment.put(Context.PROVIDER_URL, "corbaloc:iiop:localhost:2809");
    return new InitialContext(environment);
    then:
    q = (Queue) ctx.lookup(QJNDIName);
    QueueConnectionFactory connFactory = (QueueConnectionFactory)
    ctx.lookup(ConnFactName);
    I had the following exception :
    javax.naming.NameNotFoundException: Context: networking/nodes/networking/servers/server1, name: MyQueue: First component in name MyQueue not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
    Can i have any help please ....

    Hi
    You are missing some critical jar files in your class path. It should be namingclient.jar, also please or something similar that is missing in classpath.
    HTH
    VJ

  • URGENT : Problem in DataSource usage in Client applIcation

    URGENT : Problem in DataSource usage in Client applIcation
    Hi ALL
    I have deployed a EJB(Session Bean) in Oracle-OC4J Container.I am using datasources, in my bean as well as in my client
    application.Here Client is deployed along with bean in container.
    I am using "ejb-location"JNDI Name inside Client to get connection.
    (Which is mentioned in datasource element of datasources.xml)
    For this i have configured datasources.xml also.
    If i use "oracle.jdbc.pool.OracleDataSource" in datasources.xml then ClassNotFoundException is coming.
    But i have included classes12.jar in home/lib directory
    But if i use "com.evermind.sql.ConnectionDataSource" then i am getting connection.But if i do some operations(Even
    setAutoCommit(false))its giving NULL PointerException.
    Why this is happening?
    Thanx in advance
    Venky

    Hi Venkastesh,
    There are two issues. If your entry is like this....
    location="microDS"
    xa-location="jdbc/xa/MicroXADS"
    ejb-location="MicroPool"
    ...then use ejb-location for database calls through ejb and location when you try to get through normal java client.
    This will help you.
    regards,
    Vijay
    null

  • Access Oracle 9i from a Client Application without Oracle Client Install.

    Is it possible to access an Oracle Database from a Client Application without having an oracle Client Installation ?
    I want to write a program that connect to an Oracle Server. I use Borland C++. But my Programs only works with having the Client Oracle Software installed on the Client. Is there any way to realise this ?

    The way that 99% of the people that want to do this manage is to write Java code that connects to the database via JDBC, using Oracle's thin JDBC driver.
    If you absolutely have to use C++, you can purchase thin ODBC drivers from third parties (DataDirect for example) that will connect to the database without the Oracle client. I'm not aware of any thin, free ODBC drivers.
    Justin

  • Can we deploy taskflows separetly from the client application?

    Hello,
    We have projects that contains taskflows that we want to integrate into a client application. Is it possible to deploy the taskflows outside the ear of the client application? basically what we want is to be able to deploy new versions of taskflows without having to rebuild and deploy the client application.

    I followed the instructions in Andrejus Baranovskis's Blog. However when I run my client app I get the following exception:
    <2012-01-25 8 h 28 EST> <Notice> <Diagnostics> <BEA-320068> <Watch 'UncheckedException' with severity 'Notice' on server 'DefaultServer' has triggered at 2012-01-25 8 h 28 EST. Notification details:
    WatchRuleType: Log
    WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'WL-101020') OR (MSGID = 'WL-101017') OR (MSGID = 'WL-000802') OR (MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
    WatchData: DATE = 2012-01-25 8 h 28 EST SERVER = DefaultServer MESSAGE = [ServletContext@962080392[app:TaskFlowIntegration_application1 module:TaskFlowIntegration-ViewController-context-root path:/TaskFlowIntegration-ViewController-context-root spec-version:2.5]] Servlet failed with Exception
    java.lang.IllegalStateException: Attempt to validate an already invalid RegionSite:
    However when I run my client app as standalone (i.e. with the taskflow lib included in the ear) I don't get this exception. Any idea?

  • Manipulating JDBC Datasources from a java application or servlet

    How can i manipulate - add, delete, update - JDBC Datasources from a java applcation or servlet?

    Maybe we can help, if you explain a little more.
    What do you mean with:
    How can i manipulate - add, delete, update - JDBC
    Datasources from a java applcation or servlet?Do you want to
    * create databases
    * change a database's properties
    * create or change tables
    * create or change the rows in tables
    Each of these would be - more or less - possible, but on its own way.
    Or do you maybe want to configure ODBC Datasources (DSNs) for use with the JDBC-ODBC-Bridge?
    Thats all I can guess from what you told us. Tell more!

  • How do I invoke a Adobe Plugin from another Client application

    Hi,
    I have written a plug in for Adobe.
    I need to know how do i invoke this plug in from an external application
    For
    e.g a VB.NET Form has a button which on clicked would invoke this plug in
    Thanks for your suggestions in advance

    Leonard
    I would like to know how to do it
    I know that you can use IAC to call a plug-in
    I need to know the function call that i need to make in order make it happen
    MenuItemExecute doesnt seem to work for me.. or maybe i am doing something wrong there
    I can call menuitemexecute("SaveAs") but menuItemExecute("MyMenuItem")
    doesnt work
    Please advise

  • Setting a HttpSession on a web app from a client application

    Hi all,
    Using jnlp or applet, i will run a JFrame app which scans an image using the client's scanner and will send this image back to the web app, and continue to use the web app. They do not want to manually upload the image.
    I've completed running the jnlp on the client side and have gotten the image through scanning, my question is..
    How do i set this object as a HttpSession so that back at the web app, my servlet can get this session object?
    Well, I can open a HttpURLConnection to my web server, but how do i set the session object from the client app.
    Thanks.

    I've personally done this before. The solution I used was to send the image from an Applet to a Servlet via ObjectOutputStream and ObjectInputStream. Search for "applet servlet communication"

  • Obtaining initialcontext from t3 client leaks current thread

    Summary: creating an initial context from a t3 client leaks the current
    thread.
    NB: I posted about this problem recently, except that the initialcontext was
    obtained from
    within the Weblogic server. I was told that user threads should not be
    spawned from within
    the server. I've since discovered that the problem also exists from a T3
    client as well.
    Any solutions/workarounds?
    Our temporary workaround is to maintain our own thread pool, and never
    expire threads
    out of the pool. That appears to mitigate the problem, but I'm a little
    leery of reusing
    threads when it appears as though parts of Weblogic key off the thread
    object (this is
    what seems to be causing the leak in the first place.) Is this a correct
    workaround?
    Regards,
    -kb-
    Sample output:
    java -mx64m -ms64m com.snapfish.test.SimpleTestJVMSockHTTPClient: connect() success to host: localhost port: 7001 sockID: 4
    Avail mem is 66325400
    Avail mem is 66240784
    Avail mem is 66139744
    Avail mem is 66038672
    Avail mem is 65937600
    Avail mem is 65836528
    Avail mem is 65735456
    Avail mem is 65634392
    Avail mem is 65533240
    Avail mem is 65432208
    -- SimpleTest.java --
    package com.snapfish.test;
    import java.util.Properties;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    public class SimpleTest
    public static void main(String arg[])
    for (int i=0; i<1000; i++) {
    Thread t = new Thread () {
    public void run() {
    try {
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL,
    "http://localhost:7001");
    InitialContext ctx = new InitialContext(p);
    ctx.close();
    ctx = null;
    catch (Exception ex) {
    ex.printStackTrace();
    return;
    private byte buf[] = new byte[100000];
    t.start();
    try {  t.join(); }
    catch (InterruptedException ex) {
    ex.printStackTrace();
    return;
    t = null;
    System.gc();
    System.out.println("Avail mem is
    "+Runtime.getRuntime().freeMemory());

    You will need the generated stubs packaged on the client side.

  • Invoking sync programmatically from mobile client application

    Hi All,
    I am just developing a sample application using ADF mobile client for blackberry - I am able to do sync manually whenever there are updates - that is I go and execute mSync manually.
    I want to invoke this synchronization whenever the data is saved in my app. How to achieve this programmatically?
    Edited by: user12747136 on Nov 15, 2010 9:30 PM

    Hi,
    I think your problen could be solved with enabling automatic sync in the publication. In that you can specifu the rules of sync. even with 1 record being added to server side or to the client side db.
    Paninie

  • Photoshop CS5 will not close because "Could not complete your request because the client application is not responding.  Save the document from the client application..."  but I have nothing open

    Photoshop is not closing.  When I force it to close by shutting down my computer and telling it to close the application, Photoshop will not open.  Help

    operating system?
    I'd be inclined to restart your computer again.

  • Error while invoking a Dataservice from client application

    Hi,<br><br>
    Code snippet of Client to invoke DataService is....<br><br>
    Hashtable h = new Hashtable();<br>
    h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");<br>
    h.put(Context.PROVIDER_URL,"t3://10.1.5.31:7001");<br>
    h.put(Context.SECURITY_PRINCIPAL,"weblogic");<br>
    h.put(Context.SECURITY_CREDENTIALS,"weblogic"); <br>
    Context context = new InitialContext(h);<br>
    DataService ds =DataServiceFactory.newDataService(context, "HLCApp","ld:HLCAppDataServices/com/pfizer/hlc/dataservices/HCP_DETAILS"); <br>
    <u>DataObject obj= (DataObject) ds.invoke("HCP_DETAILS", null);</u><br>
    System.out.println(" HCP details : \n" + obj);
    <br><br><br>
    The line(which is underlind) is causing the error(I checked by putting some System.outs).
    <br>
    While invoking a DataService from the Client application(Java Client) I am getting the following error in the console.
    <br><br>
    Exception in thread "main" com.bea.ld.dsmediator.client.exception.SDOMediatorExc
    eption: com.bea.ld.dsmediator.client.exception.SDOMediatorException: weblogic.rj
    vm.PeerGoneException: ; nested exception is:
    java.io.EOFException
    at com.bea.ld.dsmediator.client.XmlDataServiceBase.invoke(XmlDataService
    Base.java:114)
    at com.pfizer.hlc.DSClient.HCP.main(HCP.java:23)
    Caused by: com.bea.ld.dsmediator.client.exception.SDOMediatorException: weblogic
    .rjvm.PeerGoneException: ; nested exception is:
    java.io.EOFException
    at com.bea.ld.dsmediator.client.XmlDataServiceBase.invokeQuery(XmlDataSe
    rviceBase.java:183)
    at com.bea.ld.dsmediator.client.XmlDataServiceBase.invoke(XmlDataService
    Base.java:102)
    ... 1 more
    Caused by: weblogic.rjvm.PeerGoneException: ; nested exception is:
    java.io.EOFException
    at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.j
    ava:108)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:290)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:248)
    at com.bea.ld.Server_ydm4ie_EOImpl_816_WLStub.executeFunction(Unknown So
    urce)
    at com.bea.ld.dsmediator.client.XmlDataServiceBase.invokeQuery(XmlDataSe
    rviceBase.java:157)
    ... 2 more
    Caused by: java.io.EOFException
    at weblogic.rjvm.t3.T3JVMConnection.endOfStream(T3JVMConnection.java:897
    at weblogic.socket.SocketMuxer.deliverExceptionAndCleanup(SocketMuxer.ja
    va:599)
    at weblogic.socket.SocketMuxer.deliverEndOfStream(SocketMuxer.java:549)
    at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:707)
    at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:654)
    at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:2
    82)
    at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
    32)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    <br><br><br><br>
    <b>And in the server's log file the exception is like below</b><br><br>
    <Nov 1, 2006 4:29:31 PM IST> <Error> <RJVM> <gsipl-c2-8> <cgServer> <ExecuteThread: '1' for queue: 'weblogic.socket.Muxer'> <<WLS Kernel>> <> <BEA-000503> <Incoming message header or abbreviation processing failed
    <b>java.io.InvalidClassException: javax.xml.namespace.QName; local class incompatible: stream classdesc serialVersionUID = 4418622981026545151, local class serialVersionUID = -9120448754896609940</b>
    java.io.InvalidClassException: javax.xml.namespace.QName; local class incompatible: stream classdesc serialVersionUID = 4418622981026545151, local class serialVersionUID = -9120448754896609940
         at java.io.ObjectStreamClass.initNonProxy(Ljava.io.ObjectStreamClass;Ljava.lang.Class;Ljava.lang.ClassNotFoundException;Ljava.io.ObjectStreamClass;)V(Unknown Source)
         at java.io.ObjectInputStream.readNonProxyDesc(Z)Ljava.io.ObjectStreamClass;(Unknown Source)
         at java.io.ObjectInputStream.readClassDesc(Z)Ljava.io.ObjectStreamClass;(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
         at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unknown Source)
         at weblogic.rjvm.ClassTableEntry.readExternal(ClassTableEntry.java:33)
         at java.io.ObjectInputStream.readExternalData(Ljava.io.Externalizable;Ljava.io.ObjectStreamClass;)V(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Object;(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
         at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unknown Source)
         at weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:65)
         at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:37)
         at weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.java:212)
         at weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.java:251)
         at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:748)
         at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:782)
         at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:105)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    <br><br><br>
    <b>My workstation environment is</b>
    Weblogic 8.1 SP6,Aqualogic 2.0 ,os is WindowsXP and JDK is jrockit81sp6_142_10.
    <br><br><br>
    Does anyone have any idea, why i am getting this error.
    <br><br>
    Thanks,<br>
    Suresh varma.

    Hi Suresh varma
    Did you get any answer for your problem?
    I'm having the exact same problem. Working with Weblogic 8.1 SP6 and getting this strange message whenever I'm calling my data service.
    I've followed the guidlines given on the URL posted here, and still getting the same message.
    Let me know if you have any idea.
    Cheers
    Rod

  • Encoding Error when invoking form from client application.

    I have an issue in retrieving the form data from the client application. Form (XDP File) is displayed in the browser as PDF through
    ServletOutputStream then i am trying to retrieve the data on click of the submit button. At that time the following exception is thrown:
    [8/17/07 9:20:18:212 EDT] 00000029 jsf E com.sun.faces.application.ViewHandlerImpl setRequestEncoding SRVE0254E: Failed to set request character encoding: ["utf-16"].
    java.io.UnsupportedEncodingException: SRVE0254E: Failed to set request character encoding: ["utf-16"].
    at com.ibm.ws.webcontainer.srt.SRTServletRequest.setCharacterEncoding(SRTServletRequest.java :231)
    at javax.servlet.ServletRequestWrapper.setCharacterEncoding(ServletRequestWrapper.java:158)
    at com.sun.faces.application.ViewHandlerImpl.setRequestEncoding(ViewHandlerImpl.java:364)
    at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:267)
    at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:158)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:239)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
    at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink .java:465)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink .java:394)
    at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.jav a:102)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionLi stener.java:152)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
    at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
    Note: I am able to retrieve the data, if I store the same PDF file in the local disk and invoke it from my JSP Faces file.
    i appreciate if any one can help me to resolve this issue.

    Please update me if any one have idea on this issue.

  • Jboss & Looking up DataSource from Client (not in Jboss)

    I have a project that will be describered as follows,
    1. Using Jboss server in which a DataSource is deployed
    2. Developing the Java client that looking up the above DataSource.
    My little problem is the java client is not deployed in Jboss, that is the normal java program. So can the client look up the DataSouce?
    Any help is appropriate!

    Actually I was wrong, and it makes sense why. This post is from
    David Jencks, if I recall he is the author of the JCA subsystem on jboss. This was his post on the jboss web-board (Had to look cause I tried it). I hope that you can develop some session facade beans to do whatever you would like. : )
    davidjencks
    Posts: 1,927
    Registered: Jun, 2001
    Re: Lookup DataSource from remote client      Posted: Apr 2, 2003 12:31 AM
    This is impossible and an extremely bad idea for numerous reasons.
    Write a session bean to do the db work, and call it from the remote clients.

Maybe you are looking for

  • Crackling, Popping, Buzzing Noises in Audio

    Recently (within the past week) my audio has started to crack, skip, pop, buzz, and all sorts of things. I have a Pavilion g6 1d08dx laptop with Windows 7 64-Bit, 4 GB RAM, and it's about 2 years old now, but I recently re-installed the OS, about 2 o

  • Problem in creating BOM

    Hi, While creating a material BOM, I assigned item category as L (Stock Item) for one of the component as this component is a raw material and it is externally procured. But while saving this BOM, I am getting one error message "material type ROH can

  • Excel spreadsheets

    when opening excel spreadsheets...they are not formated correctly...loose all column formating...columns are now minimum width and all fields are overlapping...making them impossible to read. I can not find a way to fix the columns...it view only...i

  • OWB 11.2 running against 11.1 DB

    Is this possible? I assume it is using a stand alone installation against the 11.1 DB and then install client tools on PC: http://download.oracle.com/docs/cd/E11882_01/owb.112/e10579/install.htm#CHDGHDAI Any issues encountered or known bugs and patch

  • Iphone internet help

    hi, i have a few questions about the inetenet functions on the iphone. i will be buying an iphone 3g in australia on pre-paid. as on pre-paid you have to buy credit so i dont want to be wasting my credit connecting to the internet via edge or 3g. usi