How to get current connection from ejb container

We have to execute sql statement directly to the database and will use for this issue to connection establish between the ejb container and the database.
How to get the corresponding object ?

thanks

Similar Messages

  • How to get a connection from ejb container

    How is it possible to get the connection used by the ejb container to execute some specific sql statement without establishing a new jdbc connection.

    repost ... please help

  • How to get internet connection from Airport Express to a PC?

    I recently bought an Airport Express to get internet connection from my new MAC COMPUTER TO ANOTHER PC which is located in another room. For unknown reason, I could not get the other PC to work. Any idea how to fix it so that I can get internet connection for my PC? Many thanks for your expert assistance.

    Currently, the Airport Express (not the Airport Express Extreme router) is acting as a base station via Ethernet to a cable modem.
    I guess that it would be correct to assume that your new Mac can connect wirelessly to the AirPort Express base station, and access the Internet that way.
    I am not sure if my 41/2 year old HP(Hewlect Packard) PC - (with AMD Athlon 64 3400 processor) which I am unable to get internet connection now is Wi-Fi capable.
    You said "Prior to using the new Airport Express,I was using the Linksys wireless G router and have a wireless adapter sitting on top of my PC.". The wireless adapter would be Wi-Fi certified (they normally are). Is it a USB adapter? Please post back with the exact model.
    Question: do I still need to use the adapter or not? Or the new Airport Express is enough to send internet signal to the PC?
    A Wi-Fi adapter would act as a wireless network card for a PC, and should communicate wirelessly with an AirPort Express base station without a problem (providing that the chosen security/encryption is supported on both sides). Since the wireless adapter apparently was OK (with the Linksys router), you should be able to continue using it. Any other (built-in) wireless capability ought to be externally visible at the PC as a PCI card with an antenna.
    Does the (Windows?) PC operating system detect any wireless networks? Is your AirPort Express on this list (even if you cannot connect or access the Internet)?
    Jan

  • How to Get Current Date from MS Access in a Select Statement

    From a java method, I want to use JDBC to get the current date from MS Access. In Oracle I would do "select sysdate from dual", but I can't figure out how to do it in MS Access. Here are some of my attempts. I have a table in my Access db called PARM.
    //        String sql = "SELECT '0', NOW() FROM PARM";
    //rs.next() is false
    //        String sql = "SELECT NOW() AS CURR_DT FROM PARM";
    //rs.next() is false
    //        String sql = "SELECT DATE() AS CURR_DT FROM PARM";
    //rs.next() is false
    //        String sql = "SELECT NOW()"; 
    //StringIndexOutOfBoundsException: String index out of range: -1
    //        String sql = "select { fn now() } from parm";
            String sql = "SELECT Date()";
    //java.lang.StringIndexOutOfBoundsException: String index out of range: -1
            ResultSet rs = stmt.executeQuery(sql);
            if (rs.next()) {
                return rs.getString(1);
            } else {
                   return null;
              }

    Why are you getting it as a String? You should be getting it as a timestamp.
    Although getString works for me too. There is something else wrong that you haven't shown.
    Here is some shoddy, but simple, test code that demonstrates it working.
    import java.sql.*;
    public class Test{
      public static void main(String args[])throws Exception{
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection c = DriverManager.getConnection("jdbc:odbc:stats");
        Statement s = c.createStatement();
        ResultSet rs = s.executeQuery("SELECT NOW()");
        while(rs.next()){
          System.out.println(rs.getTimestamp(1));     
        rs.close();
        s.close();
        c.close();
    }

  • How to get current URL from Internet Explorer ?

    Hi,
    I have design an add-on for IE and I'm
    trying to get URL from IE which is currently opened that is which is currently user sees. Is there any way to get it? I want to store that address in label and use it for something useful. Is it possible with C# ?
    I have did the following code to get current URL but it showing last opened URL instead of current URL which is user see
    using SHDocVw;
           SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindows();
                         string filename;
                         foreach (SHDocVw.InternetExplorer ie in shellWindows)
                             filename = Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
                             if (filename.Equals("iexplore"))
                               label1.Text=ie.LocationURL;
                               label1.Text = ie.LocationName;
    and I have tried this one also 
    foreach (InternetExplorer ie innew ShellWindows())
       label1.Text = ie.LocationURL.ToString();
       label2.Text = ie.LocationName.ToString();
    Please give me any suggestion or code to solve this problem.
    Thanks.
    Priyanka

    You already got addon running in the active ie instance. You just need to catch the WindowStateChanged event in every instance so you can write down the last event with OLECMDIDF_WINDOWSTATE_USERVISIBLE somewhere. When you need the active IE instance, just
    pull from your save.
    Note an IE tab may crash and take your addon with it. It is better to start a broker process to store your global data.
    Visual C++ MVP

  • How to get current month from filename and bulk insert from text file into table?

    I set up some dynamic SQL to help my bulk copy data from a text file to a table.  This works fine for files that come in every day; I get the previous day’s data, based on the file name that’s placed
    in the folder.  That’s why I’m using the ‘-1’.  The dates will look like this: '20140131', so I'm using type 112.
    declare @fullpath1 varchar(1000)
    select @fullpath1 = '''\\system.local\ms\london\FTP\' + convert(varchar, getdate()-1, 112) + '_INDEXPRICES_EOM.SPC'''
    declare @cmd1 nvarchar(1000)
    print (@cmd1)
    select @cmd1 = 'bulk insert [dbo].[SB_Monthly] from ' + @fullpath1 + ' with (FIELDTERMINATOR = ''\t'', FIRSTROW = 5, LASTROW = 675, ROWTERMINATOR=''0x0a'')'
    print(@cmd1)
    exec (@cmd1)
    I think the syntax will be somewhat similar to this:
    YEAR(date_column)=YEAR(getdate()) AND MONTH(date_column)=MONTH(getdate())
    I’m not totally sure how to incorporate that into my current syntax.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    I tried a couple versions of this.
    Declare @StartDate Date, @EndDate Date
    Select @StartDate = convert(varchar, getdate()-28, 112), @EndDate = convert(varchar, getdate()-1, 112)
    BEGIN
    declare @fullpath1 varchar(1000)
    select @fullpath1 = '''\\ms\london\FTP\' + ''' between ''' + Convert(Varchar(10), @StartDate, 101) + ''' and ''' + Convert(Varchar(10), @EndDate, 101) + '''_SP.SPC'''
    declare @cmd1 nvarchar(1000)
    print (@cmd1)
    select @cmd1 = 'bulk insert [dbo].[SPBMI_Monthly] from ' + @fullpath1 + ' with (FIELDTERMINATOR = ''\t'', FIRSTROW = 5, LASTROW = 675, ROWTERMINATOR=''0x0a'')'
    print(@cmd1)
    exec (@cmd1)
    END
    Here’s the string:
    bulk insert [dbo].[SPBMI_Monthly] from '\\ms\london\FTP\' between '02/03/2014' and '03/02/2014'_SP.SPC' with (FIELDTERMINATOR = '\t', FIRSTROW = 5, LASTROW = 675, ROWTERMINATOR='0x0a')
    The error message I keep getting is:
    Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'between'.
    Msg 319, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
    I feel like I’m already pushing this thing to the limit. 
    Maybe this last part isn’t possible.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • How to get current month from BI 7

    Dear Expert,
    I am working on a BI 7 report and I need to restrict a key figure using the current month and previous month.
    Could you help me to find out how to do so?
    Thank you very much!
    Arthur

    if you want to make  2 diff rest key figures.
    check if you have current month variable under cal.month ,  if not create a variable( single, not range ) for current month
    and make a new selection take key fig and rest with current month. 
    and make a new selection and take the key fig and restrict with  current month variable keep off set as -1
    if you want to make only one restricted key fig  which shows both current and previous then.
    create a variable as range and write a exit code from  sy-datum ( take month and year ) as the high value and substract one and make it as low value.
    Hope this helps

  • How to get Current User from edir C#

    Hi
    1) Using C# Ldap Library, How can I get the current logged in User name
    2) If I have a user name in the following format : User.Ou.Ou.O
    How can I convert that format into a DN and then find the user in
    the tree ?
    Thanks
    KaranMahant
    KaranMahant's Profile: http://forums.novell.com/member.php?userid=64239
    View this thread: http://forums.novell.com/showthread.php?t=386653

    KaranMahant;1857953 Wrote:
    > Hi
    >
    > 1) Using C# Ldap Library, How can I get the current logged in User name
    > ?
    >
    > You can use the 'getbinddn' extension facility to do this (in case you
    > use eDirectory as the server). Check the following sample:
    > http://forgeftp.novell.com/ldapcshar...s/GetBindDN.cs
    >
    > 2) If I have a user name in the following format : User.Ou.Ou.O
    > How can I convert that format into a DN and then find the user in
    > the tree ?
    >
    > There is no helper APIs available in the C# LDAP SDK to convert the
    > dotted format to ',' separated ones. If you are astarter, LDAP expects
    > the data to be in ',' separated format as:
    >
    > cn=user,ou=test,o=org.
    >
    > Thanks
    -WITH REGARDS,-
    *-Palaniappan N-*
    palaniappan1's Profile: http://forums.novell.com/member.php?userid=12325
    View this thread: http://forums.novell.com/showthread.php?t=386653

  • How to get current slide from embedded HTML5 output

    I am using php to run a web application that displays HTML5 captivate files embeded in a HTML web page. What I need to be able to do is when a user clicks a button OUTSIDE of captivate (say maybe a "Finish" button) I need to be able to check if they have completed the interactive captivate capture. My research so far has show that there is little to no documentation on captivates APIs but they do exist. It looks like java script is the best option. How can I embed the captivate HTML5 output and find out if the user completed the Captivate. This could be by slide (i.e. 10/10 slides) or by percentage or a simple "Complete" would work. I just need the value so I can pass it back to php so my app can do its thing.

    You already got addon running in the active ie instance. You just need to catch the WindowStateChanged event in every instance so you can write down the last event with OLECMDIDF_WINDOWSTATE_USERVISIBLE somewhere. When you need the active IE instance, just
    pull from your save.
    Note an IE tab may crash and take your addon with it. It is better to start a broker process to store your global data.
    Visual C++ MVP

  • How to get current row from advanced table

    Hi,
    I have the following code to pick the value of columnA from one of the columns of an advanced table:
    OAViewObject vo = (OAViewObject)am.findViewObject("AAALineVO2");
    if (vo != null)
    OARow vorow = (OARow)vo.getCurrentRow();
    String ColA = (String)vorow.getAttribute("ColumnA");
    String message = ColA; //to throw message so i can verify the value of ColumnA
    throw new OAException(message, OAException.INFORMATION);
    }It's picking up the first value of ColumnA of the first record correctly, however when I add a new row, it's not picking up the value of columnA anymore.
    What am I doing wrong?
    Thanks in advance,
    N

    Try with this:
    import oracle.apps.fnd.lookups.server.LookupCodeVORowImpl;
    public void aaa (String row)
        LookupCodeVORowImpl laborcreateeovorowimpl = (LookupCodeVORowImpl)findRowByRef(row);
    }Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to get current IUser (com.sapportals.portal.security.usermanagement)

    Hi,
    does anybody know how to get IUser for the current user?
    I know how to get current IUser from com.sap.security.api package:
    IWDClientUser wdcu = WDClientUser.getCurrentUser();
    IUser sapUser = wdcu.getSAPUser();
    but I need to have IUser from com.sapportals.portal.security.usermanagement package.
    Regards,
    Ladislav

    Ladislav,
    Try this:
    Get the IUser uisng the API com.sap.security.api.IUser and store it in a variable, say <i>sapUser</i>.
    Then,
    // Convert the logged in user to old EP5 usermanagement API
    com.sapportals.portal.security.usermanagement.IUser user = null;
    try
         com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getEP5User(sapUser);
    catch (UserManagementException e)
         e.printStackTrace();
    Bala

  • Hey there! well i from india and i m facing problem connecting my debit card to the itune store ,as the very option is not there, can someone guide me how to get it connected , i have a mastercard debit card with me .please help me

    hey there! well i from india and i m facing problem connecting my debit card to the itune store ,as the very option is not there, can someone guide me how to get it connected , i have a mastercard debit card with me .please help me

    if you are signed in to iTunes with your AppleID, click on the AppleID > view account > payment information > enter in your information

  • How to get current assigned participant id?

    Hi mates,
    This might be a basic questions, but useful for me :)
    How to get current assigned participant id from screenflow? Or How to pass it as an argument from interactive activity?
    Below is what I tried.
    Participant.id or Instance.participant.id - returns login user id
    Thanks

    Hi,
    Please correct me if I understood wrong.
    You want to know whether an instance is assigned or not and if assigned then you want to fetch the assigned participant id.
    If this is your requirement then please find the code below and make the necessary changes into it.
    Write the following code in screen flow automatic activity but before that you need to pass the instanceid as argument to the screen flow.
    In the process as well as screen flow layer make an instance variable instanceid as Int.
    Then make an argument variable instanceidArg as Int in both the screenflow and process layer and map accordingly so that it will take the instanceid from process layer to the screen flow layer.
    Assign instanceid = id.number; in process layer automatic activity but before the global interactive activity where you have maped the screen flow.
    Write the following code in screen flow automatic activity.
    logMessage("============= instanceid ==============" + instanceid); //instanceid is the id of the instance that you have passed from process layer.
    ProcessService ps;
    InstanceFilter instF = InstanceFilter();
    ps.connectTo(url : Fuego.Server.directoryURL, user : "<userid>", password : "<password>"); //In studio the userid and password will be same
    logMessage("Connected");
    instF.create(processService : ps);
    instF.searchScope = SearchScope(participantScope : ParticipantScope.ALL, statusScope : StatusScope.ONLY_INPROCESS);
    //<ProessId Name> is the id of the process where you want to know the assighed participant id
    instF.addAttributeTo(variable : VarDefinition.processid, comparator : Comparison.CONTAINS, value : "/" + "<ProessId>");
    instF.addAttributeTo(variable : VarDefinition.INSTANCE_NUMBER, comparator : Comparison.IS, value : Int(instanceid));
    Fuego.Papi.Instance[] instances = getInstancesByFilter(ps, filter : instF);
    foreach (instance in instances) {
    logMessage("Assigned ?: " + instance.participantId.empty);
    logMessage("instance.participantId: " + instance.participantId);
    ps.disconnectFrom();
    Bibhu

  • Calling a Java aplication from EJB container

    We have a standalone Java application which is thread safe, and works well when called from web container. Now we are planning to call this app from EJB container (We are using OC4J) i.e our client apps which call this Java app will be written as EJBs. Our concern is to make sure that our application's thread mechanism does not conflict with EJB Container's thread mechanism. Any thoughts on this will be appreciated. Thanks. (Mubashar Tariq)

    Thread management isn't really a problem as long as you keep a couple of things in mind:
    1. You(r EJB) can only act on incoming calls (or messages) or so to say
    2. You're not allowed to spawn threads when acting on an incoming call
    3. Calls via RMI may timeout (check the default SocketFactory for the timeout, I think it's about 3 mins)
    Calling an outside application isn't really a problem as well I think. As long as you remember the two rules above and the following: an EJB cannot have two 'clients'. So if your application gets called and you're somehow able to reach (within your standalone application) the EJB, you're not allowed to call it (because it's already called by somebody else, on which the EJB acts).
    Also you should check if OC4J (I don't really know) offers the possibility of having resourcemanagers for RMI. Just opening an RMI connection might not be possible from an EJB. HTTP however is (but then you would have to open an HTTP server at the client, the rules above would not apply then however).
    The solution I see:
    either bind a Object in the RMI Registry you create at the client or open a ServerSocket. Somehow the EJB making the client application gets called (via the Web part???), it contacts the client application via the ServerSocket or the RemoteObject and does it work. Then the business method ends and the thread the EJB is working on dies...
    alef

  • How to get maximal value from the data/class for show in Map legend

    I make WAD report that using Map Web Item.
    I devide to four (4) classes for legend (Generate_Breaks).
    I want to change default value for the class by javascript and for this,
    I need to get maximal value from the class.
    How to get maximal value from the data/class.
    please give me solution for my problem.
    Many Thx
    Eddy Utomo

    use this to get the following End_date
    <?following-sibling::../END_DATE?>
    Try this
    <?for-each:/ROOT/ROW?>
    ==================
    Current StartDate <?START_DATE?>
    Current End Date <?END_DATE?>
    Next Start Date <?following-sibling::ROW/END_DATE?>
    Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
    ================
    <?end for-each?>
    o/p
    ==================
    Current StartDate 01-01-1980
    Current End Date 01-01-1988
    Next Start Date 01-01-1990
    Previous End Date
    ================
    ==================
    Current StartDate 01-01-1988
    Current End Date 01-01-1990
    Next Start Date 01-01-2005
    Previous End Date 01-01-1988
    ================
    ==================
    Current StartDate 01-01-2000
    Current End Date 01-01-2005
    Next Start Date
    Previous End Date 01

Maybe you are looking for