Best way to access JNDI configured DataSource from outside container

I'm not sure if this is the right forum category, but it seemed like a good place to start.
I have a DB2 database on an OS/390 mainframe that is configured as a JNDI datasource in WebSphere (WSAD) 5.1.x. I can get connections and do database transactions within my web-application just fine.
Part of my project needs a cron managed stand-alone application to do some database clean up work. It essentially needs to query one database, and then based on the results stick some data into the DB2 database. Easy enough right?
The issue here is that our Security department will not under any circumstances give us the passwords and users for either database. They give these only to the server admins who configure WSAD. We also can't use a properties file. The server admins either won't touch any properties file (it is considered "code" and they don't want to be responsible for problems) or they won't have access to the contents of the ears or jars we give them. This basically leaves us with our JNDI datasource as the only datasource we could access (because the admins will have it configured with a username and password). There is also no way to infer a valid username/password from the owner of the web-app since it will live on an NT box and the NT user won't have mainframe rights.
There is also no possibility of bending these rules no matter how stupid or cumbersome they are.
So my question is, what is the best method in which to gain access to this JNDI DataSource or a Connection from this DataSource? Can I even get a DataSource from a JNDI lookup? Is JMS/RMI or some other acronymn that I don't know about the only way to acomplish this?
We're using Struts MVC -> Spring -> Hibernate in the webapp, if that helps.
Thanks in advance.

You seem to be asking: "how can a standalone app get a valid DB2 connection by leveraging the live objects in a WSAD application"?
While this is pretty far from my area of expertise, I don't think you can. While both JMS and RMI (and other technologies) can export some types of Java objects, they have to be objects that implement the java.io.Serializable interface. Connections cannot be serialized because these objects (normally) encapsulate a live TCP/IP connection. I don't see any fundamental reason a DataSource object couldn't be serialized other than security, but that very reason means that no reasonable implementation is going to be serializable; if it were serializable, you could almost certainly extract the value of the username and password from the serialized object. In other words, what you're really trying to do is get around security and Java's security is probably robust enough to prevent it.
If the DB credentials only live in the WSAD world, that's where the database work has to be done. However, there's no reason the work can't be driven by a servlet or JSP that is in turn invoked from a cron-driven script or application. Personally, I do such "event notifier" scripts in Perl; Java is a bit heavy for "start up, post to URL, shutdown", but if you have more work going on you could certainly use Java. If actually doing the work in the WSAD application is not acceptable, then you're probably stuck.

Similar Messages

  • Best Way to Migrate a configuration from one sun webserver to another

    Hi,
    What is the best way to migrate a configuration from one Sun Webserver to another? I am using Webserver 7 Update 5 on Linux. If I just copy the configuration directory, the administration server doesn't know it. Thanks!

    I found my answer.. I found this link - http://forums.sun.com/thread.jspa?threadID=5317534

  • What is the best way of accessing application module without page binding?

    Hi All
    I am using Jdeveloper 11g R2 (11.1.2.3) & Weblogic 10.3.5.0
    What is the best way of accessing application module without page binding?
    In my application after user authenticated from LDAP
    I need to read some information from database and set my menues.
    Thanks
    Mohsen

    Hi,
    if you don't have a binding the I am not sure the binding context is created. Anyway, try
    BindingContext.getCurrent().findDataControl("name here as ID in DataBindings.cpx") and see if it returns a valid instance
    Frank

  • Hello! I have a MAC OS X version 10.6.8. What is the best way to access to lion?Thanks

    Hello,
    I have OS X version 10.6.8. What is the best way to access to lion?
    Thanks

    You obtain Lion by purchasing, then downloading and installing it over the internet from the Apple App Store.
    Hope this helps

  • Best way to access my mac G4 files when working on a windows pc laptop

    Hi - I'm looking for ideas on the best way to access files stored on my G4 mac, when working on a pc laptop elsewhere in the house.
    I'm not sure if this involves setting up a network, or whether I should be looking at ftp or even bluetooth.
    Just to explain what I'm after: I'm writing a book, primarily on my g4 (running panther) in my study. But I spend a large proportion of my day running after my rampaging toddler. I'd like to make better use of my time by being able to grab my partner's laptop and write while my toddler is occupied for twenty minutes.
    Messing around with a memory stick etc would just take too long as I'd have to remember to update the main file. It would get very messy!
    I hope someone can help!
    Thanks, Tina
    Message was edited by: tinaMac

    Between the networking question(s) to connect the two different platform
    computers, using Sharing and other settings in each, the next question is
    about the software used in the documents you are to be creating in one
    and sending to the other.
    Do you have a similar word processing software for the PC as in the Mac;
    or something compatible in creating and using .RTF documents, etc. Or,
    if you have a Windows version of AppleWorks, that would work. And the
    TextEdit in your OS X can handle rich text format word processing; and
    probably open basic text from a PC fairly easy. (And Word, etc, can.)
    Issues in sharing, are such that you have to be careful when changing the
    settings in your computers, that you don't accidentally share your computer
    contents with other persons and computers in the vicinity. By wire would be
    the most secure, since Ethernet can be used locally to share.
    Internet and wireless may be a possibility, too; or using a local shared external
    drives, if visible to both computers, depending on the network setup.
    Do you have a USB hard disk drive set up on your wireless network, and
    formatted in Fat32 so the Mac and PC can both see and use it? If so, you
    may be able to send documents to there from the PC and use them in the
    Mac. This may work, and depending on how the files were organized, not
    too hard to keep up with the draft copies generated from the PC for use in
    the Mac at a later time, and so on. This way, both computers would not
    need to be on, to send & receive a file...
    {For that matter, using a Google Account could be helpful;
    to just email the writing to yourself, at any computer.}
    Anyway, there are several possibilities, including those in the link to another
    discussion on that topic per the above post.
    Good luck & happy computing!

  • Accessing a configuration file from a Web Service

    I have a business logic class that loads in a file of records and then has various searching methods provided. The way that it is currently used is via a servlet that has one parameter in the web.xml file that is the location of the properties file. This servlet creates a Configuration singleton by passing the location from the web.xml. The Configuration singleton reads in the properties file. The business logic class gets the location of the record file from the Configuration singleton to then read it in. I am trying to wrap this business logic class with a web service now and am not sure how to go about initializing the Configuration singleton without hardcoding the location of the properties file.
    Can anyone tell me what the best method of reading in configuration items from within a web service (i.e. an equivalent to the servlet web.xml method)? Where in the EAR or WAR should this properties file be located and then how do you get to it? I am using WebLogic 8.1 and creating the web service with the WebLogic Ant tasks (servicegen, wspackage, clientgen, etc.).
    Thanks,
    Adam

    okay, so actually, was attributing my problem to the wrong thing. in fact, another coding error (the way i was reading lines from the buffered reader) is to blame. turns out you CAN read from a file in the init or the doGet...
    bear with me, i'm just learning but anybody able to tell me why i can't trigger a FileNotFoundException here, even if i pass the FileReader a file that doesn't exist:
    try {
    BufferedReader r = new
    BufferedReader(new FileReader("???"));
    String s = r.readLine();
    int i=1, j=0;
    while (s != null) {
    if (i%2==0) {
    mailInfo[j] = s;
    j++;
    s = r.readLine();
    i++;
    catch (FileNotFoundException e) {
    e.printStackTrace();
    catch (IOException e) {
    e.printStackTrace();
    }

  • What is the best way to transfer my iphoto library from old imac to new imac. both have iphoto 9.2.1

    What is the best way to transfer my iphoto library from current imac to my new imac.  Both imacs have iphoto 9.2.1
    os on old imac is 10.6.8.   os on new imac is 10.7.2.   I want the albums  and events to stay intact.  I have 4500 photos and 79 videos. 14.9 gb. looking for some advice here. Thanks so much.

    Connect the two Macs together (network, firewire target mode, etc) and drag the iPhoto library intact as a single entity from the old Mac to the pictures folder of the new Mac - launch iPhoto on the new mac and it will open the library and convert it as needed and you will be ready move forward.
    LN

  • Iphone 4s coming friday, what is the best way to get the notes content from iphone 4 to 4s without doing a restore? i want the new phone to be totally new but not sure how to get notes content across.

    What is the best way to get the notes content from iphone 4 to 4s without doing a restore? i want the new phone to be totally new but not sure how to get notes content across. If I do a restore as I have when previously from one iphone to another it has shown (in settings, usage) the cumulative usage from previous phones so all the hours of calls on all previous iphones will be displayed even though its brand new. Anyone know how I can get my notes (from standard iphone notes app) to my new iphone 4s without restoring from previous iphone 4. Thanks for any help offered.

    First, if you haven't updated to iTunes 10.5, please update now as you will need it for the iPhone 4S and iOS 5.
    Once you're done installing iTunes 10.5, open it. Connect your iPhone to iTunes using the USB cable. Once your iPhone pops up right click on it. For example: an iPhone will appear and it will say "Ryan's iPhone."
    Right click on it and select "Backup" from the dropdown menu. It will start backing up. This should backup your notes.
    Please tell me if you have any problems with backing up.
    Once you backup and get your iPhone 4S, you must follow these steps. If you don't follow these steps, you will not be able to get your notes on your new iPhone 4S.
    Open up iTunes again then right click on your device (iPhone 4S). Once you do you will see a dropdown menu. It will say "Restore from Backup..." Select this and it'll ask for a backup, select it from the dropdown menu. For example "Ryan's iPhone - October 12, 2011." Pick that and it will restore to your backup. Do this when you get your iPhone 4S so you will not lose anything. Even though you're restoring, you're getting back, since you're getting the previous settings, notes, contacts, mail and other settings from your old iPhone. You'll still have Siri though! So, restore when you first get it. Also frequently backup your device, as it will be worth it. You can restore from a backup if something goes wrong or save your data for a future update.
    Once you do that, you should have your notes on your new iPhone 4S and iOS 5.
    Please tell me if you need any help.
    I hoped I answered your questions and solved your problem!

  • What is the best way to create a database schema from XML

    What is the best way to create a database schema from XML?
    i have  a complex XML file that I want to create a database from and consistently import new XML files of the same schema type. Currently I have started off by mapping the XSD into Excel and using Mysql for Excel to push into MySQL.
    There must be a more .net microsoft solution for this but I cannot locate the topic and tools by searching. What are the best tools and way to manage this?
    Taking my C# further

    Hi Saythj,
    When mentioning "a database schema from XML", do you mean the
    XML Schema Collections? If that is what you mean, when trying to import XML files of the same schema type, you may take the below approach.
    Create an XML Schema Collection basing on your complex XML, you can find
    many generating tools online to do that.
    Create a Table with the above created schema typed XML column as below.
    CREATE TABLE youTable( Col1 int, Col2 xml (yourXMLSchemaCollection))
    Load your XML files and try to insert the xml content into the table above from C# or some other approaches. The XMLs that can't pass the validation fail inserting into that table.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • What is the best way to call a pageflow action from JavaScript?

    What is the best way to call a pageflow action from JavaScript?
    Thanks,
    John

    John,
    How would I do this from a grid??? Unfortunately there are no JavaScript attributes
    on any of the grid tags that I can see.
    Thanks,
    John
    "John H" <[email protected]> wrote:
    >
    Thanks John!
    "John Rohrlich" <[email protected]> wrote:
    John,
    If you want to put up a confirm dialog before calling an action from
    an
    anchor it is done as follows.
    Here is an example from code of mine that deletes a customer order,if
    the
    user confirms the delete. I pass the order id as a parameter.
    - john
    Here is the JavaScript -
    function confirmDelete() {
    if(confirm('Continue with order delete?'))
    return true;
    else
    return false;
    Here is a sample anchor tag -
    <netui:anchor action="requestToDeleteOrder" onClick="return
    confirmDelete(); return false;">
    Delete
    <netui:parameter name="orderId" value="{container.item.orderId}"/>
    </netui:anchor>
    "John H" <[email protected]> wrote in message
    news:402138f5$[email protected]..
    Thanks for the replies. I figured it was going to require buildingmy own
    url
    to call the action. I had hoped there was an easier way to do it.Rich,
    the
    reason I want to do this is because I want to call the JavaScript
    function
    confirm()
    when a user clicks on a link (in a repeater/grid) to drop a record,I only
    want
    to call the drop action if the user confirms the drop. Maybe thereis a
    better
    way to do what I am trying to do??? I really appreciate any help
    you
    guys
    can
    give me on this, I am pretty new to this sort of stuff.
    Thanks,
    John
    "Rich Kucera" <[email protected]> wrote:
    "John H" <[email protected]> wrote:
    What is the best way to call a pageflow action from JavaScript?
    Thanks,
    JohnTry figuring out the URL to the pageflow action, create a hidden
    form
    in the
    page, then use JS to submit the form. Why would you want to though,
    isn't
    the server going to want to send you to the next page?

  • Is there a way to access ABAP OO instances from a batch job report

    Hello,
    I am looking for a way to access ABAP OO instances from a batch job report. My circumstances are the following:
    I have got some ABAP OO coding that identifies other objects (class instances) that have to be processed (they have a DoIt method that does some calculation). As this processing is time consuming and performace relevant I have to parallelize this in batch jobs. This batch jobs however can only be "simple" ABAP reports according to SM36. The problem is now that I dont really know how to tell the batch job report what objects to process. Somehow I have to access theses instances from  that batch job report.
    Does anybody have an idea?
    Greetings
    Matthias

    Hi David,
    thanks a lot for your help. After a lot of searching on the net this seems to be the only way to cope with it. However I am not sure about the locking mechanisms and if its suitable for mass data processing. In the help page you suggested the following is stated which I do not fully understand::
    "The current lock logic does not enable you to set specific locks for the following requirements:
    ·        Many parallel read and write accesses
    ·        Frequent write accesses
    ·        Division into changeable and non-changeable areas
    Although the lock logic makes the first two points technically possible, they are not practical because most accesses would be rejected."
    Does this mean
    a) if I dont want to set "specific locks" for frequent write accessess I am fine
    or
    b) I am discouraged from use shared memory technics for frequent write accessess?
    In the latter case I will have a problem...
    What do you think?
    Greets
    Matthias

  • Can you suggest a best way to store and read arabic from oracle database?

    Hi ,
    can you suggest a best way to store and read arabic from oracle database?
    My oracle database is Oracle Database 10g Release 10.1.0.5.0 - 64bit Production on unix HP-UX ia64.
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CHARACTERSET WE8ISO8859P1
    I have presently stored the data in nvarchar2 field. But i am not able to display it correctly.

    Using the national characterset should work but there are other factors that you have to consider when working with NCHAR/NVARCHAR2/NCLOB.
    If possible, changing the characterset is usually the best solution if it's a possiblity for you.
    For more info:
    Dear Gurus: Can u pls explain the difference between VARCHAR2 & NVARCHAR2??

  • Best way to create a conact list from the user profile properties

    We have a customer looking for a phone book utility, starting with a table showing main user information and with some search options. We would like o base it on the user profile properties and not to create an indipendent studion record browser porlet.
    What is best way to create a conact list from the user profile properties ?

    I did something like this using search.  It can get messy, so you need to take care with it.
    * Identify the properties you want to make accessible to search (ex: name, etc.)
            - add them to the user property map
            - flag them as searchable
    * I broke down and used the native server API.  I'd still suggest this approach.
    * Write some simple code to do vcard export if you like
    (my code is all in vb.net)
    I really believe this is the &#034;right&#034; approach, but honestly, this was a bit painful and has been
    messy for us given some other business issues.  (to my chagrin we have users with 2-letter last
    names...)
    I have code you're welcome to poke at, but it's more or less slapped together and has various
    different search methods commented out so you can see how I tinkered w/ the remote vs. server
    API.
    If you'd like it mail me at [email protected] and I'll send you a zipped copy w/ a
    readme.  I hope it may be useful to you as both a starting reference.

  • What is the best way to cancel the related update from aboutToUpdate ?

    What is the best way to cancel the related update from DescriptorEventAdapter.aboutToUpdate ?
    Anyway to manipulate descriptorEvent.getQuery() so that it doesn't generate anything?
    In our specific case, TopLink 11 - EclipseLink 2.0.2 generates useless update, so we want to silence them to avoid DB round trip.

    Mustafa,
    Thats the way to kill the Job, But We are not Authorized for SM50.
    At present we will raise a request to the Basis to do that. Speaking from user point of view is there any better way to handle it.
    Tony

  • Best way to transfer a 10g database from HP9000 to Linux Redhat?

    What is the best way to transfer a 10g databasse from HP9000 to Linux Redhat?

    Hi Bill,
    What is the best way to transfer a 10g databasse from HP9000 to Linux Redhat?Define "best"? There are many choices, each with their own benefits . . .
    Fastest?
    If you are on an SMP server, parallel CTAS over a databaee link can move large amnunts of tables, fast:
    http://www.dba-oracle.com/t_create_table_select_ctas.htm
    I've done 100 gig per hours . . .
    Easiest?
    If you are a beginner, data pump is good, and I have siome tips on doing it quickly:
    http://www.dba-oracle.com/oracle_tips_load_speed.htm
    Also,, make sure to check the Linux kernel settings. I query http://www.tpc.org and search for the server type . . .
    The full disclosure reports show optimal kernel settings.
    Finally, don't forget to set direct I/O in Linux:
    http://www.dba-oracle.com/t_linux_disk_i_o.htm
    Hope this helps . . .
    Donald K. Burleson
    Oracle Press author
    Author of "Oracle Tuning: The Definitive Reference" http://www.rampant-books.com/book_2005_1_awr_proactive_tuning.htm

Maybe you are looking for

  • PDF Forms - continuous text

    I am trying to set up a PDF form for a client using Acrobat Professional since I don't have LiveCycle (I am on a Mac and don't do a lot of web based projects). See attached file for example of what I am trying to do: The fields at the top are all ind

  • Compressor fails to create output after hours of processing.

    I've had mixed results from Compressor 2, it does seem very slow, the interface is not intuitive, the error reporting is unhelpful. It does seem to offer everything I need, if only it would work as expected. The problem I'm seeing now is that often w

  • Azureus crash

    After my system update this afternoon Azureus crashes on startup. When deleting the profile it actually starts, but crashes upon adding a torrent. Any ideas on this? # An unexpected error has been detected by Java Runtime Environment: # SIGSEGV (0xb)

  • Error creating new Open Directory domain

    The wizard for creating a new Open Directory domain in Server.app on Mountain Lion responds with the following error message:      "An error occurred while configuring My Server as a directory server.  Please check your network configuration and try

  • Solution Manager Client copy

    We finished client copy from 000 to 900 with profile SAP_CUST in Solution Manager. If we copy only user accounts from 001 to 900, this will overwrite what ever we did with SAP_CUST profile  ?