How to Use SQLJ

I have used JPublisher to create and SQLJ and now I am trying to figure out how to call the function that is included in it.
I am attempting to populate the standard WHO fields for a custom table. Maybe there is an easier way to do it.
Thanks in Advance

The following excerpt from the forthcoming SQLJ FAQ may also provide help.
How can I use SQLJ with Oracle's BC4J?
"I am using BC4J (Oracle's Business Components For Java) in my application, and would like to write SQLJ code for performing some work in the database. Is it possible to do that?"
The following trick lets you obtain a real JDBC connection and create a SQLJ connection context:
import java.sql.Connection;
import sqlj.runtime.ref.DefaultContext;
import sqlj.runtime.ConnectionContext;
Connection conn = getDBTransaction()
.createCallableStatement("select 1 from dual",1)
.getConnection();
DefaultContext ctx = new DefaultContext(conn);
#sql [ctx] ... { ... };
ctx.close(ConnectionContext.KEEP_CONNECTION); // clean up SQLJ context

Similar Messages

  • Simple Java class using SQLJ not compiling.

    Hello all, I have a simple Java class that is using SQLJ. It will not compile though. I am not sure what I should set for classpath. Any ideas? This is what I have so far.
    set PATH=C:\jdk1.2.2\bin;c:\oracle\ora81\jdbc\bin;
    set CLASSPATH="C:\oracle\ora81\jdbc\lib\classes12.zip;C:\oracle\ora81\sqlj\lib\runtime12.zip;C:\oracle\ora81\sqlj\lib\translator.zip;C:\jdk1.2.2\lib\*.*"
    then
    javac SQLJTester.java
    Here is my .java file ---
    import java.io.*;
    import java.sql.*;
    import sqlj.runtime.*;
    import sqlj.runtime.ref.*;
    public class SQLJTester {
    public static void update() throws Exception {
    java.sql.Timestamp timeNow;
    #sql {
    BEGIN
    :timeNow := sysdate;
    END
    public static void main (String[] args) {
    try {
    SQLJTester.update();
    System.out.println ("Updated successfully");
    catch (Exception e) {
    System.out.println ("Caught an exception.");
    Thanks ahead for your time,
    Justin

    When sqlj files are compiled and translted to java file with them the file with extension .ser is also generated. browsers do not recognise this .ser files they only understand .class files which the download using <codebase> instead of class path. so thats why you r not able to use sqlj in servlet. try to customize the profile. Now can some one inform how to use sqlj from eclipse. does it support?. i need to downoad sqlj.exe for that. if anyone has idea from where i can download sqlj.exe pls inform me at [email protected]

  • How to run sqlj.exe to translator Sqlj file which depends other file

    I want to use sqlj.exe to compile sqlj file. I don't know what option can be set for Sqlj.exe can automatically compile sqlj file and it's dependent file(sqlj or java).
    Here is one case:
    There are three six files.
    p1\A.sqlj
    p1\A1.sqlj
    p2\B.sqlj
    p3\C.java
    p3\DI.java
    p4\E.java
    1.the Class A has been declared as follow:
    public class A extends C implements DI{
    And in A.sqlj file, Class B and A1 will be used.
    2.the class E has been declared as follow:
    public class E extends C{
    I want run sqlj.exe as follow:
    sqlj -d=. A.sqlj
    Does it can auto compile C.java, DI.java and A1.sqlj, B.sqlj?
    We known, when java file is compiled, the dependent java file will be auto compiled,
    for example, the command,
    javac E.java
    will compile E.java and C.java.
    But how sqlj.exe automatically compile dependent file.
    Thanks,

    I want to run an exe file Runtime.exec()
    installed in a server from a client machine Server program that executes Runtime.exec() if told to do so by a client via a socket connection
    everyday at a particular (fixed) time.Look at System.currentTimeMillis(), Calendar, Date, Timer...

  • Developing JSP using SQLJ

    Does anyone know how to develop JSP using SQLJ? This chapter is not availabe in the developer's guide. And which one is a better solution, JSP + BC4J or SQLJ?

    I would stick with the JDK 1.1.8 in JDeveloper 3.0. SQLJ and JDBC do not yet support JDK 1.2 (they will in Oracle 8.1.6 and JDeveloper 3.1... not sure about OAS 4.0.9, but I would suspect so).
    Laura

  • Retrieving cursor names using SQLJ

    Hi,
    I would like to know if & how its possible to get the cursor name of a resultset using SQLJ.
    The Statement.setCursorName()/getCursorName() gives me a "Feature not supported" when I use the oracle internal driver "jdbc:odbc:kprb", but the same method works for a simple JDBC:ODBC bridge.
    Thanks,
    Joe

    I am not sure if my reply is relevant. But if you have a named iterator in SQLJ, you may try
    myIter.getResultSet().getCursorName().
    null

  • How to use orinda Software generated classess

    hai all,
    iam newly useing jdev any body tell me how to use orinda generated classes. can send me sample code for this & can u tell me what is use of this.

    OrindaBuild examines your data dictionary and generates Java source code to run your PL/SQL procedures and Functions.
    It can also generate Java to run any SQL statement you give it. The generated code does not require SQLJ.
    General documentation can be found here:
    http://www.orindasoft.com/public/Docstwo.php4
    An example can be found here:
    http://www.orindasoft.com/public/Exampletwo.php4
    Say you have a PL/SQL package you want to access using JDBC:
    CREATE OR REPLACE PACKAGE complex_example AS
    TYPE city_pair_plsql_record IS RECORD (from_city flights.departure_city%type
                                          ,to_city   flights.arrival_city%type);
    PROCEDURE flies_between_all (p_first_city_pair  in  city_pair_oracle_type
                                ,p_second_city_pair in  city_pair_plsql_record
                                ,p_third_city_from  in  airports%ROWTYPE
                                ,p_third_city_to    in  airports%ROWTYPE
                                ,p_airline_list     out simple_examples.airline_refcursor_type);
    PROCEDURE get_table_of_flights_from (p_city         in     flights.departure_city%TYPE
                                        ,p_flights_from    out flights_table);
    PROCEDURE add_bookings (p_customer       in     customers%ROWTYPE
                           ,p_booking_table  in     bookings_table
                           ,p_status_message    out varchar2);
    END;OrindaBuild would generate code like this:
    package com.mycompany.myproject.generated;
    import com.orindasoft.pub.CSException;
    import com.orindasoft.pub.OracleResourceUser;
    import com.mycompany.myproject.generated.plsql.*;
    * WSDL Compatible Web Services Interface used by classes generated by OrindaBuild
    * Generated by OrindaBuild 5.0 build 2342 at 2007/01/19 18:02:18 GMT
    public interface DAOFactoryServiceInterface
    public com.mycompany.myproject.generated.plsql.SimpleExamplesAirlineRefcursorTypeAttrs[]
    servicePlsqlComplexExampleFliesBetweenAll
        (CityPairOracleTypeAttrs paramPFirstCityPair
        ,ComplexExampleCityPairPlsqlRecordAttrs paramPSecondCityPair
        ,AirportsAttrs paramPThirdCityFrom
        ,AirportsAttrs paramPThirdCityTo) throws DAOFactoryServiceException;
    public FlightsTypeAttrs[] servicePlsqlComplexExampleGetTableOfFlightsFrom
        (String paramPCity) throws DAOFactoryServiceException;
    public String servicePlsqlComplexExampleAddBookings
        (CustomersAttrs paramPCustomer
        ,BookingsTypeAttrs[] paramPBookingTable) throws DAOFactoryServiceException;
    } // Generated by OrindaBuild 5.0                                                 The rest of the generated code for this example is available here:
    http://www.orindasoft.com/public/Java2HTML
    As you can see from the code above each procedure in the package is called by a method in the generated code. OrindaBuild is really useful is situations where the PL/SQL has complicated parameters.
    David Rolfe
    Orinda Software
    Dublin, Ireland
    null
    null

  • How to use 'oprofc' procedure?

    How to use 'oprofc procedure'?
    I don't find this program in JDEVELOPER2.0 directory.
    is it necessary to launch 'oprofc' to use some oracle-specific
    features (form exemple: CLOB)
    null

    David,
    Please also see my reply to your other query about SQLJ and
    CLOBs. It is my understanding that this script is only necessary
    for command line SQLJ operations, and I don't believe it is still
    used with 8.1.
    Because JDeveloper handles the SQLJ translation for you, we do
    not provide the command line utilities. They should be available
    with either your server installation or the Oracle Client
    distribution if you would like to use them.
    -L
    David DUPONT (guest) wrote:
    : How to use 'oprofc procedure'?
    : I don't find this program in JDEVELOPER2.0 directory.
    : is it necessary to launch 'oprofc' to use some oracle-specific
    : features (form exemple: CLOB)
    null

  • How to use one email adress for multiple recipients

    Hello,
    I'd like to know how to use one email adress for multiple recipients. 
    this would be very useful or projects. for example;
    if i send one mail to [email protected], all people in this project get an email.
    I will add the people in this project myself. 
    I know it is possible, but I don't know how to do it ;-)
    please help me! 

    Hope this help.
    _http://technet.microsoft.com/en-us/library/cc164331(v=exchg.65) .aspx

  • Can't figure out how to use home sharing

    Since the latest couple iTunes updates, my family and I can not figure out how to use home sharing. Everyone in our household has their own iTunes, and for a long time we would just share our music through home sharing. But with the updates, so much has changed that we can no longer figure out how to use it.
    I have a lot of purchased albums on another laptop in the house, that im trying to move it all over to my own iTunes, and I have spent a long time searching the internet, and everything. And I just can't figure out how to do it. So.... how does it work now? I would really like to get these albums from my moms iTunes, onto mine. I would hate to have to buy them all over again.
    If anyone is able to help me out here, that would be great! Thanks!

    The problem im having is that after I am in another library through home sharing, I can't figure out how to select an album and import it to my library. They used to have it set up so that you just highlight all of the songs you want, and then all you had to do was click import. Now I don't even see an import button, or anything else like it. So im lost... I don't know if it's something im doing wrong, or if our home sharing system just isn't working properly.
    Thanks for the help.

  • How to use the same POWL query for multiple users

    Hello,
    I have defined a POWL query which executes properly. But if I map the same POWL query to 2 portal users and the 2 portal users try to access the same page simultaneously then it gives an error message to one of the users that
    "Query 'ABC' is already open in another session."
    where 'ABC' is the query name.
    Can you please tell me how to use the same POWL query for multiple users ?
    A fast reply would be highly appreciated.
    Thanks and Regards,
    Sandhya

    Batch processing usually involves using actions you have recorded.  In Action you can insert Path that can be used during processing documents.  Path have some size so you may want to only process document that have the same size.  Look in the Actions Palette fly-out menu for insert path.  It inserts|records the current document work path into the action being worked on and when the action is played it inserts the path into the document as the current work path..

  • How to use airport time capsule with multiple computers?

    I'm sure there are some thread about this but i couldn't find it... so sorry for that but hear me out! =)
    I bought the AirPort Time Capsule to back up my MBP
    And so i did.
    then i thought "let give this one a fresh start" so i erased all of it with the disk utility and re-installed the MBP from the recovery disk.
    I dont want all of the stuff i backed up just a few files and some pictures so i brought that back.. so far so good.
    Now i want to do a new back up of my MBP so i open time machine settings, pick the drive on the time capsule and then "Choose" i wait for the beck up to begin, and then it fails.  It says (sorry for my bad english, im swedish haha) "the mount /Volume/Data-1/StiflersMBP.sparsebundle is already in use for back up.
    this is what i want:
    i want the "StiflersMBP.sparsebundle" to just be so i can get some stuf when i need them. it's never to be erased.
    i want to make a new back up of my MBP as if it's a second computer...
    so guys and girls, what is the easiest and best solution?
    Best regards!

    TM does not work like that.
    If you want files to use later.. do not use TM.
    Or do not use TM to the same location. Plug a USB drive into the computer and use that as the target for the permanent backup.
    Read some details of how TM works so you understand what it will do.
    http://pondini.org/TM/Works.html
    Use a clone or different software for a permanent backup.
    http://pondini.org/TM/Clones.html
    How to use TC
    http://pondini.org/TM/Time_Capsule.html
    This is helpful.. particularly Q3.
    Why you don't want to use TM.
    Q20 here. http://pondini.org/TM/FAQ.html

  • How to use multiple ipods on one account

    I have an Ipod classic and just bought my sons two nano's how do I use these on the same account without changing my account info?

    Take a look here:
    How to use multiple iPods with one computer
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Discussions page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums, in the User Tips Library and in the Apple Knowledge Base before you post a question.
    Regards.

  • How to use a Table View in AppleScriptObjC

    How can I use a table view and add data to it? And how can I display a button cell and image cell in the table? Thanks.

    Hi all,
    Actually i need some more clarification. How to use the same select statement, if i've to use the tabname in the where clause too?
    for ex : select * from (tab_name) where....?
    Can we do inner join on such select statements? If so how?
    Thanks & Regards,
    Mallik.

  • How to use '|' delimited as seprator in GUI_DOWNLOAD ? Plz suggest me ,,

    how to use '|' delimited as seprator in GUI_DOWNLOAD ? Plz suggest me ,,
    i want the output should be seprated by '|' delimited when i download the file.

    Hi,
    We will pass the seperator to the WRITE_FIELD_SEPARATOR parameter as
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filename = v_file
    write_field_separator = '|'
    TABLES
    data_tab = itab[] . "Our internal talbe filled with data
    Re: Why Function GUI_DOWNLOAD can create XML file but not a flat file?
    Award points if useful
    Thanks,
    Ravee...

  • ** How to use TO_DATE function in Stored Proc. for JDBC in ABAP-XSL mapping

    Hi friends,
    I use ABAP-XSL mapping to insert records in Oracle table. My Sender is File and receiver is JDBC. We use Oracle 10g database. All fields in table are VARCHAR2 except one field; this is having type 'DATE'.
    I use Stored procedure to update the records in table. I have converted my string into date using the Oracle TO_DATE function. But, when I use this format, it throws an error in the Receiver CC. (But, the message is processed successfully in SXMB_MONI).
    The input format I formed like below:
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">
    Value in Payload is like below.
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">TO_DATE('18-11-1991','DD-MM-YYYY')</X_EMP_START_DT>
    Error in CC comes as below:
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'SP_EMP_DETAILS' (structure 'STATEMENT'): java.lang.NumberFormatException: For input string: "TO_DATE('18"
    Friends, I have tried, but unable to find the correct solution to insert.
    Kindly help me to solve this issue.
    Kind Regards,
    Jegathees P.
    (But, the same is working fine if we use direct method in ABAP-XSL ie. not thru Stored Procedure)

    Hi Sinha,
    Thanks for your reply.
    I used the syntax
    <xsl:call-template name="date:format-date">
       <xsl:with-param name="date-time" select="string" />
       <xsl:with-param name="pattern" select="string" />
    </xsl:call-template>
    in my Abap XSL.  But, its not working correctly. The problem is 'href' function to import "date.xsl" in my XSLT is not able to do that. The system throws an error. Moreover, it is not able to write the command 'extension-element-prefixes' in my <xsl:stylesheet namespace>
    May be I am not able to understand how to use this.
    Anyway, I solved this problem by handling date conversion inside Oracle Stored Procedure. Now, its working fine.
    Thank you.

Maybe you are looking for