TopLink - dynamically create session connection?

Hi all
How can PLS, I dynamically create the connection to the database?
I use toplink workbench and in this step 6: [http://www.oracle.com/technology/products/ias/toplink/doc/11110/tutorial/intro/standalone/intro_tutorial010.htm#CIHIHIFF] I do not check "save the Login and password"...
If I put the password and static user, everthing works fine, bud I need dynamically created connection... my code is:

+ createSession() protected Sub throws Exception {+
System.setProperty ("toplink.xml.platform", "oracle.toplink.platform.xml.jaxp.JAXPPlatform");
XMLSessionConfigLoader loader = new XMLSessionConfigLoader (getSessionsXmlPath ());
Bishop SessionManager = oracle.toplink.tools.sessionmanagement.SessionManager.getManager ();
session.setLogin (applyLogin ());
session = (ServerSession) mgr.getSession (loader, getSessionName(), Thread.currentThread () .getContextClassLoader (), true, true);
+}+

+ private DatabaseLogin applyLogin() {+
DatabaseLogin connection = new DatabaseLogin();
login.usePlatform (new oracle.toplink.platform.database.oracle.Oracle8Platform ());
login.setDriverClassName ("oracle.jdbc.OracleDriver");
login.setConnectionString ("path"); JDBC:Oracle:thin:@host:port:SID - path is OK (but SECRET) :-)
login.setUserName ("user"); USER NAME - user is OK, but hawa ;-)
login.setEncryptedPassword ("pass"); PASSWORD, ENCRYPTED password is OK ;-)
Returns the user name;
+}+

but he always returns java.lang.NullPointerException! If I set password and user of TopLink workbench, if it works...

Any ideas, how to configure Java connection, pls?

SRY for my English...

Thanks in advance!
BES cordially, KLD

Your session variable has the value null until you attribute to him, so you can not call a method on it.

Try,

session = (ServerSession) mgr.getSession (loader, getSessionName(), Thread.currentThread () .getContextClassLoader (), false, true);
session.setLogin (applyLogin ()); \
session. Login());

Means that the fake is not to identify the session.

----
James: http://www.eclipselink.org

Tags: Fusion Middleware

Similar Questions

  • When I try to connect directly in multiplayer FSX without gamespy, every time I get an error message saying: unable to create the connection to the host.

    When I try to connect directly in multiplayer FSX without gamespy, every time I get an error message saying: unable to create the connection to the host.

    I need help
    Kind regards

    Thank you very much!

    To host successfully a FSX session what follows is the key enabling

    my client (s) to join my host FSX session!

    "Players Maximum (for a shared together plane 2) leave the locations reserved for friends to 0 set."

    6122 6112 UDP port translation FSX multiplayer traffic of my remote 2 wire gateway to my router Linksys Wireless N DMZ to access game FSX host...

    Only a single router in my configuration of the DMZ, the external network to the router,

    in this case, the 2 wires, had defined port forwarding.

    Am now enjoying Gamespy (R.I.P.) FSX free hosting for my MP FSX sessions via direct connection.

    5 high to the author!

  • Number of sql developer for single schema created sessions

    Hi all

    11.2.0.3

    RedHat 5

    I go into the architecture stuff and I know, that's a session connection to a dedicated database server process is allocated.hence for each session, there will be an id of operating processes and a SID on oracle

    But when I set a unique connection of sql developer I see two process IDs and two sid. Can someone by the light on it.

    5847 1 Oracle Sep25 0?        00:00:02 ora_i104_dev

    5851 1 Oracle Sep25 0?        00:00:02 ora_i105_dev

    5855 1 Oracle Sep25 0?        00:00:02 ora_i106_dev

    5859 1 Oracle Sep25 0?        00:00:01 ora_i107_dev

    5863 1 Oracle Sep25 0?        00:00:01 ora_i108_dev

    5867 1 Oracle Sep25 0?        00:00:01 ora_i109_dev

    5871 1 Oracle Sep25 0?        00:00:01 ora_i10a_dev

    5875 1 Oracle Sep25 0?        00:00:01 ora_i10b_dev

    5879 1 Oracle Sep25 0?        00:00:01 ora_i10c_dev

    5883 1 Oracle Sep25 0?        00:00:01 ora_i10d_dev

    5887 1 Oracle Sep25 0?        00:00:01 ora_i10e_dev

    5891 1 Oracle Sep25 0?        00:00:01 ora_i10f_dev

    5895 1 Oracle Sep25 0?        00:00:01 ora_i10g_dev

    5962 1 Oracle Sep25 0?        00:00:02 ora_smco_dev

    Oracle 22034 1 0 01:33?        00:00:00 /u01/app/oracle/product/11.2.0.3/db1/bin/tnslsnr-heriter listener

    root 22132 3202 0 01:37?        00:00:00 sshd: oracle [priv]

    Oracle 22136 22132 0 01:38?        00:00:00 sshd: oracle@pts/1

    Oracle 22137 22136 0 01:38 pts/1 00:00:00 - bash

    root 22162 3202 0 01:38?        00:00:00 sshd: oracle [priv]

    Oracle 22166 22162 0 01:38?        00:00:00 sshd: oracle@pts/2

    Oracle 22167 22166 0 01:38 pts/2 00:00:00 - bash

    Oracle 22189 22167 0 01:38 pts/2 00:00:00 sqlplus as sysdba

    Oracle 22192 22189 0 01:38?        00:00:00 oracledev (DESCRIPTION =(LOCAL=YES) (ADDRESS = (PROTOCOL = DOB)))

    Oracle 22228 1 0 01:40?        00:00:01 oracledev (LOCAL = NO)

    Oracle 22234 1 0 01:40?        00:00:04 oracledev (LOCAL = NO) (* this is the sqldeveloper *)

    root 22697 3202 0 02:19?        00:00:00 sshd: oracle [priv]

    Oracle 22702 22697 0 02:19?        00:00:00 sshd: oracle@pts/3

    Oracle 22703 22702 0 02:19 pts/3 00:00:00 - bash

    Oracle 22795 1 0 02:23?        00:00:00 ora_w000_dev

    Oracle 22865 1 0 02:29?        00:00:00 ora_j000_dev

    Oracle 22869 1 0 02:29?        00:00:00 ora_j001_dev

    Oracle 22872 22703 0 02:30 pts/3 00:00:00 ps - eaf

    Oracle 22873 22703 0 02:30 pts/3 00:00:00 grep ora

    Upstairs, there are two process of oracledev id once I plugged of sqldeveloper. While local connection for the same schema from OS creates only simple process.

    We create two

    1. the main connection for tree, spreadsheet reports, etc.
    2. secondary connection for the insight of code have - as you type in a worksheet, we ask for the names of objects, etc.

    However, you can have more than two. If you open a spreadsheet not shared, this will create a dedicated connection, new for this worksheet.

    In addition, if you open a repository, as for migration or unit tests, again, it is a new connection.

  • Audit selective create session

    Is there a way to do the audit of fine particle size more to "create session".

    I want to audit only create session for a select list of users when they connect to specific machines.

    For example, our web server has a specific user, in that it connects to oracle. I would like to audit create session for the user when he is not from the web server.

    My current solution is to audit create session for these users, and then having a job that cleans the records, I don't want.

    Using sqlnet.ora you can specify allowed and denied IP addresses. So, in theory, you could only allow the IP address of the web server. This would prevent developers to connect from their seats, depending on the configuration of the network.

    Another option would be to use the ROLES of APPLICATION SECURITY. In the secure application roles, the role is not enabled unless that some conditions, such as defined by you, are met. Therefore, you can set a condition that says that the client must have a specific IP address. If they have it activated the role, otherwise, the role is disabled.

    HTH!

    Published by: Centinul on February 19, 2009 14:21

    I wanted to also add in the secure application role, you can check the program customer, and in your case, it may be something like php - cgi *. You can only allow the role to be activated when a PHP program is run on the web server. However, this is not a complete solution because theoretically the user could write their own client and set the program setting must match that of the PHP program. However, depending on your other configurations, this can be a minimal risk that can be accepted.

  • You will need to create a question to create a connection.

    Just need to create a question to create a connection. Mozilla may want to think about giving users the ability to create a connection without having to ask a question. Many of us are probably just a newspaper to answer to an existing message, as is my case today.

    Problem is that this forum is getting spammed the latter time (especially with streams tv shows) if it was easier to get an account and post without making a question first then this forum may end eventually and see even more spam.

    Most of the members perhaps not abreast of the spam unless they come to see him before a mod/admin has marked as spam and it is hidden.

    more easy no earlier.

  • When dynamically created variables are emptied in the sequential process template?

    I have a sequence TestStand 2014 in which I dynamically create and fill many FileGlobal variables in the installation section of my main sequence.  I have it using the TestStand API to read the data in an Excel file (the data consists mainly of thresholds, limits, etc.).  The methodology itself works flawlessy.

    However, there are differences in behavior when using entry points both execution of the sequential process model.  When you use the entry point of execution 'Single Pass', he has no problem in test a DUT after another.  However, when you use the entry point for execution "Test DUT", I encounter the following error after completing of DUT1 and DUT2 testing:

    An error occurred the call 'InsertSubProperty' in 'PropertyObject' of 'NI TestStand 2014 API.

    The name of the element "VariableName" is not valid because it is already in use.

    I interpret this error message means that the variable I am trying to dynamically create the DUT2 track is already present race of DUT1.  I have a few questions about this:

    1. at what point in the sequential process template are dynamically created variables flushed, such as run a further by using 'Single Pass' starts with a clean slate?

    2. is there a reminder that I can substitute such as variables to rinse after each HAD run, allowing me to dynamically create variables on each HAD, during execution using "Test UUT?

    3. better yet, is there a counter of TestStand I can query to determine if I already ran DUT1 when using "Test DUT", such as DUT2 uses the variables that were created dynamically on trail of DUT1?

    Or you can simply use the PropertyExists function as a precondition.

    PropertyExists ("Locals.Foo")

  • How to dynamically create variables of StationGlobals who are LabVIEWIOControl

    I'm looking for a way to dynamically create variables StationGlobals LabVIEWIOControl.  I know not how to create variables through "PropertyObject/SetValXXX", however I have some difficualty create variables that are custom data types.

    Thank you

    Bryon

    Bryon,

    You can use an expression as follows:

    StationGlobals.NewSubProperty("MyVariable",PropValType_NamedType,False,"LabVIEWIOControl",0)

    I hope this helps!

  • create the connection to the datafinder Server

    Is there a way to create a connection to the datafinder server in the script? I have a file location that must be typed in (you cannot find by browsing through the folders) and want to know if there are other methods of adding connections to the server.

    Thank you

    Artemis

    I was able to use the following which fixed my problem

    Call Navigator.ConnectDataFinder ("my DataFinder"). GetSettings(). SearchAreas.Add)
    Call Navigator.ConnectDataFinder ("my DataFinder"). Indexer.IndexFolder)

    But now I wonder if there is a way to check if a search box already exists in the datafinder.

  • dynamically create and destroy the custom menu item

    I have a standard TestStand platform that I use on multiple systems.  On some systems, I have a few sequences of calibration and I would like to have the Update menu to have the RunSequence of these sequences of calibration.  I know how to manually create these menu items, but they are no longer valid for some sequence files.  I would use the sequence SequenceFileLoad to dynamically create menu items and the SequenceFileUnload to destroy these menu items.

    I've played around with the API, but cannot determine the correct path to get to the create and destroy the custom menu items.  Does anyone know how this can be done?

    Thank you

    Matthew

    Yes, see the online help for the members of the following APIs:

    Engine.GetEditTimeToolMenuItems

    EditTimeMenuItems

    EditTimeMenuItem

    Basically, you get a collection of tool using Engine.GetEditTimeToolMenuItems () menu items and then call EditTimeMenuItems.Insert () or EditTimeMenuItems.Remove (). If you insert a you get returns an EditTimeMenuItem object on which you can change the settings.

    In addition, since it has an expression to hide items in menu tool, you need not necessarily to destroy, you can hide them instead.

    Hope this helps,

    -Doug

  • Time of design and of the dynamically created controls

    I have a project written in VC6 as a project of the MFC dialog box. In a particular area, I dynamically create several (the exact number depends on user input) CNiGraphs. There is also a two CNiButtons that were created at design time using the resource editor. The problem I have is that when this dialog box is open, a message appears saying it is an eval version and the control will go off after 5 minutes. After 5 minutes of waiting, the CNiButtons 2 go inactive (black tower), but the continuous CNiGraphs of work. I have a valid license of MStudio 8.1.6, version but it seems that these 2 buttons do not recognize the license. There are also other buttons from the moment of conception of the project, but these have no problem at all. When you create the dynamic creation of the CNiGraphs, give them a valid license string, and I was wondering if there is a problem with the time created and dynamically controls created in the same dialog box to design. Anyone know?

    I don't remember, but I can have created these 2 CNiButtons when I was with only an eval license. (All others were undoubtedly create when I got a full license) Could have an impact on them? I have a vague memory of reading somewhere that DTC create controls to check the license when they are created in the designer and store that info in them license. If this is the case does anyone know an easy way to update the license stored in control? I rather not just delete it and Add again because I would avoid having to redo the tab order (unless someone knows how to easily insert something in the middle of the order of tab instead of having to click through all the controls in the correct order)?

    In addition, I don't know if this would affect anything, but the project was originally built with ComponentWorks 1.0, we were forced to move to MStudio when we met a few bugs in CW, so all controls were originally CW controls which have been converted into control of CNi. I doubt that this is so like everywhere else, we changed during controls is not a problem, but I'm ready to try the suggestions.

    Hi JC,.

    I hope you had a good weekend!  I'm glad to hear that you're back running.  Add the extra button was, in fact, causing update the licensing information for the other buttons, as you can imagine.  After further research, I found that the license information are stored only the form of the control, and if this control doesn't change in any way (or in your case, adding a new project), he sees no reason when compiling to recreate a link to the license.  However, after the change of control and a new, it updates the link between the license information, which solved this problem in your case.

    I hope this helps, JC.  Have a great day!

  • Mapping to a Windows 7 disc from a XP platform, it creates the connection but it says "share: denied \Access.»

    Original title: mapping to a Windows 7 disc for XP platform

    Hi all is there anyone who can help me with the mapping a drive of windows 7 from my xp machine? I shared the drive on the computer 7 and everyone has permissions with full game. I can map other machines windows 7 itself but not some xp machines. I can ping the machine 7 machine xp with the address and the name of the computer. Now when I map the drive to create the connection but it says "share: denied \Access.»
    Any help is greatly appreciated.

    Hello Jgg5037,

    Double check to make sure that all computers are part of the same working group:
    Disable host group on the Windows 7 computer:
    Let us know if any of these methods help you resolve the error "access denied."
  • How to dynamically create action item?

    Hi, I want to dynamically create point.

    Before I want to create using qml, but does not seem possible

    http://supportforums.BlackBerry.com/T5/Cascades-development/how-to-create-action-item-of-page-dynami...

    So maybe better to use C++ to create dynamically,

    I'm already try but are still not

    So I have a custom control qml (a Navigation pane)

    name List.qml

    the structure is like this:

    NavigationPane {}

    {Page}

    objectName: myPage

    {Of container

    ....

    }

    }

    }

    How to add action item to this .qml?

    I'm already try that, but failed

    C++ :

    Engine QDeclarativeEngine;

    QDeclarativeComponent component(&engine,QUrl::fromLocalFile("List.qml"));)

    QObject * object = component.create ();

    Page * myPage = object->findChild ("Edit");  Maybe, on that note, I'm wrong implemented? -> not found?

    ActionItem * action1 = ActionItem::create () .title ("first action");

    my page-> addAction (action1, ActionBarPlacement:nBar);

    Remove the object;

    How to create this dynamic Action item?

    Help, please

    Thank you

    Hello

    QML, the object name must be included between "" marks.

    Name of the object of your Page will be:

    objectName: "myPage"
    

    You can reach any CPP QML object like this:

    This excerpt comes from YourProjectName.cpp

    // create scene document from main.qml asset
    // set parent to created document to ensure it exists for the whole
    // application lifetime
    
    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
        // create root object for the UI
        AbstractPane *root = qml->createRootObject();
        // set created root object as a scene
        app->setScene(root);
    
    //and here comes the findChild method
    Page* qmlPage = root->findChild("myPage");
    

    After this, you can create any object on the side of C++ QML, as your own code:

    ActionItem* action1 = ActionItem::create().title("First action");
    myPage->addAction(action1, ActionBarPlacement:nBar);
    

    Don't have no need to create a QObejct, or declarative stuff.

  • ConnectionFactory cannot create the connection using BIS_B

    By using the code below

    Import net.rim.device.api.io.transport.ConnectionDescriptor;

    Import net.rim.device.api.io.transport.ConnectionFactory;

    Import net.rim.device.api.io.transport.TransportInfo;

    SerializableAttribute public class MyConnectionFactory extends ConnectionFactory {}

    public MyConnectionFactory() {}

    Super();

    setPreferredTransportTypes (new int [] {TransportInfo.TRANSPORT_TCP_WIFI, TransportInfo.TRANSPORT_BIS_B});
    setDisallowedTransportTypes (new int [] {TransportInfo.TRANSPORT_WAP,

    TransportInfo.TRANSPORT_MDS,

    TransportInfo.TRANSPORT_WAP2,

    TransportInfo.TRANSPORT_TCP_CELLULAR});

    setConnectionMode (ConnectionFactory.ACCESS_READ_WRITE);

    }

    }

    I am unable to create the connection BIS_B...

    If anyone can help...

    Read the documentation of BisBOptions. You will discover.

    Please accept as solution if my suggestion works for you.

  • Dynamically create QmlComponentDefinition objects in the code

    With QML sample:

    // --- main.qml ---Container {    objectName: "fooContainer"    attachedObjects: [        ComponentDefinition {            id: barComponent            source: "Bar.qml"        }    ]}
    
    // --- Bar.qml ---Container {    objectName: "bar"    Label {        text: "FooBar"    }}
    

    I am trying to dynamically create barComponent objects and add them to fooContainer in C++ code.

    So I reference the using fooContainer:

    fooContainer = createdRootObject->findChild("fooContainer");
    

    But how to reference the definition of QML barComponent to use his method createObject()?

    The definition of the element is used to create the object of QML

    To create the C++ object, you need to do:

    qml = QmlDocument::create("asset:///Bar.qml");
    Control *root =  qml->createRootObject();
    fooContainer->add(root)
    
  • Creating a connection HTTP using BIS

    Hello

    I need to retrieve data from my web service using KSoap and BIS as a means of connection. From what I've heard, create HTTP through BIS connections is available for third party applications if the developer is a member of the Alliance of BlackBerry program (which I am currently not a part of). But I also heard that there is a backdoor method of doing that is by registering to the BlackBerry PUSH services.

    I was wondering if someone could explain to me how I could use this secret method to create a connection HTTP using BIS.

    Thanks in advance.

    you add to a bes connection "; deviceside = false', for example.
    a BIS connection uses an appendage of connection string similar, is it the seekrit.
    You can 'discover' this string seekrit by downloading the sample to bis push (not the simplified I wrote), you can do it without registering.

    You can probably find it on google as well, but the forums have a word filter to apply the policy of it being forbidden to know

Maybe you are looking for