How to use java source in Oracle when select by sqlplus.

How to use java source in Oracle when select by sqlplus.
I can create java source in Oracle
import java.util.*;
import java.sql.*;
import java.util.Date;
public class TimeDate
     public static void main(String[] args)
public String setDate(int i){
GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(new Date((long)i*1000));
System.out.println("Dateline: "
+ calendar.get(Calendar.HOUR_OF_DAY) + ":"
+ calendar.get(Calendar.MINUTE) + ":"
+ calendar.get(Calendar.SECOND) + "-"
+ calendar.get(Calendar.YEAR) + "/"
+ (calendar.get(Calendar.MONTH) + 1) + "/"
+ calendar.get(Calendar.DATE));
String n = calendar.get(Calendar.YEAR) + "/" + (calendar.get(Calendar.MONTH) + 1) + "/" + calendar.get(Calendar.DATE);
     System.out.print(n);
     return n;
I have table name TEST
ID DATE_IN
1 942685200
2 952448400
When I write jsp I use method setDate in class TimeDate
The result is
ID DATE_IN
1 1999/11/16
2 2003/7/25
Thanks you very much.

It is unclear where you are having a problem.  Is your issue at runtime (when the form runs in the browser) or when working in the Builder on the form?
Also be aware that you will need to sign your jar and include some new manifest entries.  Refer to the Java 7u51 documentation and blogs that discuss the changes.
https://blogs.oracle.com/java-platform-group/entry/new_security_requirements_for_rias
http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html

Similar Messages

  • How to use Java Script in Oracle Forms 10g

    Hello,
    Appreciate if anyone could help me using Java Script in Oracle Forms 10g?
    Thanks
    GM

    Thank you for your reply. I was reading on the metalink that we could use the to call the java script from oracle Forms 10g (Doc ID 265863.1)
    Example:
    WEB.SHOW_DOCUMENT ('javascript:void(window.open("http://www.oracle.com","","location=no,toolbar=no,menubar=no,status=no,"));self.close()','_blank');
    I tried it but it did not open the any window as it claims. Am I missing anything? Is there any IE related setting which I need to modify for the above to work?
    Regards
    GM

  • How to use java programe in oracle form

    Hello Expert,
    My Config is : -
    Forms [32 Bit] Version 11.1.1.3.0 (Production)
    Jdeveloper - 10.1.3
    I want to use the java programe in form builder. I create the one java class in Jdeveloper -
    package demo;
    import java.net.InetAddress;
    import java.net.NetworkInterface;
    import java.net.SocketException;
    import java.net.UnknownHostException;
    public class get_info{
       public static void main(String[] args){
       ch_add();
       public static void ch_add()
      InetAddress ip;
      try { 
      ip = InetAddress.getLocalHost();
      /*System.out.println("Current IP address : " + ip.getHostAddress());  */
      NetworkInterface network = NetworkInterface.getByInetAddress(ip);
      byte[] mac = network.getHardwareAddress();
      /*System.out.print("Current MAC address : ");   */
      StringBuilder sb = new StringBuilder();            
      for (int i = 0; i < mac.length; i++)
      sb.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : ""));
      System.out.println(sb.toString()); 
      } catch (UnknownHostException e) {
      e.printStackTrace();
      } catch (SocketException e){
      e.printStackTrace();
    and this into Formweb.cfg and default.env and also add into Form_class_path. After that i import this java into forms.
    Code genertated -
    PACKAGE BODY get_info IS
      -- DO NOT EDIT THIS FILE - it is machine generated!
      args   JNI.ARGLIST;
      -- Constructor for signature ()V
      FUNCTION new RETURN ORA_JAVA.JOBJECT IS
      BEGIN
        args := NULL;
        RETURN (JNI.NEW_OBJECT('demo/get_info', '()V', args));
      END;
      -- Method: main ([Ljava/lang/String;)V
      PROCEDURE main(
        a0    ORA_JAVA.JARRAY) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_OBJECT_ARG(args, a0, '[Ljava/lang/String;');
        JNI.CALL_VOID_METHOD(TRUE, NULL, 'demo/get_info', 'main', '([Ljava/lang/String;)V', args);
      END;
      -- Method: ch_add ()V
      PROCEDURE ch_add IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(TRUE, NULL, 'demo/get_info', 'ch_add', '()V', args);
      END;
      -- Method: wait (J)V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT,
        a0    NUMBER) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_LONG_ARG(args, a0);
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '(J)V', args);
      END;
      -- Method: wait ()V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '()V', args);
      END;
      -- Method: wait (JI)V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT,
        a0    NUMBER,
        a1    NUMBER) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(2);
        JNI.ADD_LONG_ARG(args, a0);
        JNI.ADD_INT_ARG(args, a1);
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '(JI)V', args);
      END;
      -- Method: equals (Ljava/lang/Object;)Z
      FUNCTION equals(
        obj   ORA_JAVA.JOBJECT,
        a0    ORA_JAVA.JOBJECT) RETURN BOOLEAN IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_OBJECT_ARG(args, a0, 'java/lang/Object');
        RETURN JNI.CALL_BOOLEAN_METHOD(FALSE, obj, 'demo/get_info', 'equals', '(Ljava/lang/Object;)Z', args);
      END;
      -- Method: toString ()Ljava/lang/String;
      FUNCTION toString(
        obj   ORA_JAVA.JOBJECT) RETURN VARCHAR2 IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_STRING_METHOD(FALSE, obj, 'demo/get_info', 'toString', '()Ljava/lang/String;', args);
      END;
      -- Method: hashCode ()I
      FUNCTION hashCode(
        obj   ORA_JAVA.JOBJECT) RETURN NUMBER IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_INT_METHOD(FALSE, obj, 'demo/get_info', 'hashCode', '()I', args);
      END;
      -- Method: getClass ()Ljava/lang/Class;
      FUNCTION getClass(
        obj   ORA_JAVA.JOBJECT) RETURN ORA_JAVA.JOBJECT IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_OBJECT_METHOD(FALSE, obj, 'demo/get_info', 'getClass', '()Ljava/lang/Class;', args);
      END;
      -- Method: notify ()V
      PROCEDURE notify(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'notify', '()V', args);
      END;
      -- Method: notifyAll ()V
      PROCEDURE notifyAll(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'notifyAll', '()V', args);
      END;
    BEGIN
      NULL;
    END;
    Now i want to call the o/p of Java programe in oracle text item. Please help me. It's very urgent. I am not good in Java.

    Sir i use java importer.
    PACKAGE BODY get_info IS
      -- DO NOT EDIT THIS FILE - it is machine generated!
      args   JNI.ARGLIST;
      -- Constructor for signature ()V
      FUNCTION new RETURN ORA_JAVA.JOBJECT IS
      BEGIN
        args := NULL;
        RETURN (JNI.NEW_OBJECT('demo/get_info', '()V', args));
      END;
      -- Method: main ([Ljava/lang/String;)V
      PROCEDURE main(
        a0    ORA_JAVA.JARRAY) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_OBJECT_ARG(args, a0, '[Ljava/lang/String;');
        JNI.CALL_VOID_METHOD(TRUE, NULL, 'demo/get_info', 'main', '([Ljava/lang/String;)V', args);
      END;
      -- Method: ch_add ()V
      PROCEDURE ch_add IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(TRUE, NULL, 'demo/get_info', 'ch_add', '()V', args);
      END;
      -- Method: wait (J)V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT,
        a0    NUMBER) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_LONG_ARG(args, a0);
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '(J)V', args);
      END;
      -- Method: wait ()V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '()V', args);
      END;
      -- Method: wait (JI)V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT,
        a0    NUMBER,
        a1    NUMBER) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(2);
        JNI.ADD_LONG_ARG(args, a0);
        JNI.ADD_INT_ARG(args, a1);
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '(JI)V', args);
      END;
      -- Method: equals (Ljava/lang/Object;)Z
      FUNCTION equals(
        obj   ORA_JAVA.JOBJECT,
        a0    ORA_JAVA.JOBJECT) RETURN BOOLEAN IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_OBJECT_ARG(args, a0, 'java/lang/Object');
        RETURN JNI.CALL_BOOLEAN_METHOD(FALSE, obj, 'demo/get_info', 'equals', '(Ljava/lang/Object;)Z', args);
      END;
      -- Method: toString ()Ljava/lang/String;
      FUNCTION toString(
        obj   ORA_JAVA.JOBJECT) RETURN VARCHAR2 IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_STRING_METHOD(FALSE, obj, 'demo/get_info', 'toString', '()Ljava/lang/String;', args);
      END;
      -- Method: hashCode ()I
      FUNCTION hashCode(
        obj   ORA_JAVA.JOBJECT) RETURN NUMBER IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_INT_METHOD(FALSE, obj, 'demo/get_info', 'hashCode', '()I', args);
      END;
      -- Method: getClass ()Ljava/lang/Class;
      FUNCTION getClass(
        obj   ORA_JAVA.JOBJECT) RETURN ORA_JAVA.JOBJECT IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_OBJECT_METHOD(FALSE, obj, 'demo/get_info', 'getClass', '()Ljava/lang/Class;', args);
      END;
      -- Method: notify ()V
      PROCEDURE notify(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'notify', '()V', args);
      END;
      -- Method: notifyAll ()V
      PROCEDURE notifyAll(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'notifyAll', '()V', args);
      END;
    BEGIN
      NULL;
    END;
    I read both document which is given by you.
    Basicaly i don't know how to call java program in form builder.
    I wrote this code on When-button-pressed
    DECLARE
    jo ora_java.jobject;
    rv varchar2(1500);
    ex ora_java.jobject;
    BEGIN
    jo := get_info.new;
    rv:=get_info.ch_add(jo );
    EXCEPTION
    WHEN ORA_JAVA.JAVA_ERROR then
      message (' Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR );
      message('');
    WHEN ORA_JAVA.EXCEPTION_THROWN then
      ex := ORA_JAVA.LAST_EXCEPTION;
      message(' Unable to call out to Java ' ||Exception_.toString (ex ) );
      message(' Unable to call out to Java ' ||Exception_.toString (ex ) );
    END;
    No error comes and no output comes. I want the client MAC ID. please guide me where i need to change the code.

  • How to use Java Beans in Oracle Forms 11g at 64 bit windows7

    Hello Experts,
                  I am using Oracle forms 11.1.2.2.0 with weblogic 10.3.6 generic at windows 7 64 bit.
    My java version is jdk1.7.0_51.
    Now I have a htmlbutton.jar (which is for bean item in oracle form and this jar file works well for oracle forms 11g 32 bit windows 7 environment).
    I have takken steps:
    1:-Put jar file in home\java folder.
    2:-add this jar file into archive in formsweb.cfg.
    3:-Add this this jar file(which is in my home- java folder) in form_class path in registry.
    Now when I try to locate this jar file in my oracle form.There is no such jar file.what are the steps to use this jar file in oracle forms bean item.
    Please told me what is wrong here.
    thank you
    regards
    aaditya.

    It is unclear where you are having a problem.  Is your issue at runtime (when the form runs in the browser) or when working in the Builder on the form?
    Also be aware that you will need to sign your jar and include some new manifest entries.  Refer to the Java 7u51 documentation and blogs that discuss the changes.
    https://blogs.oracle.com/java-platform-group/entry/new_security_requirements_for_rias
    http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html

  • Help : Unable to use Java Beans in Oracle forms 6i

    Hi ,
    I have been trying to run few sample code to understand how to use Java beans in oracle forms 6i .But have been largely unsuccessfull.
    It will be great if somebody can provide me with some simple form( and java code )which uses java beans concept to give some data to the java program and receive some data from it . Pls inform me about the settings that need to be done.
    If you guys know it then pls take the pains of writing a simple form and java code.
    i hope somebody will respond because your reply is very necesary for me to proceed.
    U can email me the code > [email protected]
    Thanks in advance.

    Thanks for your reply Francois.
    Actually i am not facing problem understanding the programming technique.
    I think the problem at my end is more of a cofiguration one.I am using forms version 6i
    on oracle 8.
    Every time i set the imlementation class property of the bean area it gives an error 13010 which translates to that "the class being mentioned is not extending the IView class".
    The class i have written extends VBean so i am not sure why this error is occuring.
    I think if oracle (correctly) finds the java class to use then i will be able to proceed.
    Pls reply.
    If you have some code that is working fine then pls send it to me.And also inform is some environment variables have to be set for its use.

  • How to generate Java source using clientgen WL8.1?

    Hi, does anybody know how to generate Java source code using clientgen task on WL 8.1 Sp4 or SP5? I know WL 9.0 clientgen can do this, but we are still on SP5. Basically I want to look at the source code (I was wondering why it didn't work if I initialize a service impl by passing the WSDL URL string different than the URL specified in the original WSDL file that the clientgen is run against.)
    Does anybody also know how get web service client developed on Axis work on WebLogic without conficting the web service developed on WebLgoic that is running in the same box?
    Thanks for your help!

    hi ,
    As mentioned in the Question, I am unable to find the "Java Proxy Generattion" link in the Int builder.
    Also the help doc says:
    Java proxy generation is no longer supported in subsequent releases. For new developments or when making significant changes to a service interface, use Java proxy generation in SAP NetWeaver Studio instead. More information: Creating Outside-In Web Services, SAP NetWeaver Developer Studio.
    Does that mean that I can no longer generate java proxy from Int builder?
    regards,
    Piyush

  • How to send HTML Format Mail using Java Mail in oracle 9i Forms

    Dear All
    could you please tell me how to send HTML Format Mail using Java Mail in oracle 9i Forms and how to implement the java mail ?
    if it is possible, could you please send me the sample code? please very urgent
    Thanks
    P.Sivaraman

    Hello,
    <p>Here is a Form sample.</p>
    Francois

  • How to use java script when popups are blocked in browser

    How to use java script when popups are blocked in browser

    Not. When people install a popup blocker they don't WANT popups, so stop trying to force them down their throats.

  • How to use java api for function activity in embed oracle workflow?

    because i can't install standalone oracle workflow successfully.
    pls tell me how to use java api for function activity in embed oracle workflow?
    are there some patch or pulg-in package?
    ths a lot...........

    The Java Function Activity Agent is not certified for Oracle Workflow embedded in Oracle Applications. Installing standalone workflow should be a lot easier than what you have found, although it looks like you did hit a Pentium 4 issue with the Oracle Universal Installer. I suggest you contact Oracle Support or Oracle Consulting for assistance.
    because i can't install standalone oracle workflow successfully.
    pls tell me how to use java api for function activity in embed oracle workflow?
    are there some patch or pulg-in package?
    ths a lot...........

  • How to use java 6 and uninstall java 7 ?

    Curently I'm facing some problem uninstall java 7, whenever I delete java 7 and install java 6,  when i check on my java -version it is showing java version "1.7.0_09".
    How can use java 1.6 instead of 1.7 ? Please help thanks.

    The following article should show you how:
       https://service.parachat.com/knowledgebase/226/How-can-I-uninstall-Oracle-Java-7 -and-reinstall-Apples-Java-6-on-my-Mac.html
    Hope this helps

  • How to deploy java bean in Oracle Applications?

    There is a Oracle Applications Forms FNDMNMNU.fmb which calls a Java Bean to show TreeView.
    The Bean Area uses the implementation class of AppletAdapter.class. Do you know that we have to use the same AppletAdapter class so that we can connect to Oracle database?
    In the form of FNDMNMNU.fmb, the java bean is called like this.
    fndaplt.applet_init('FND_MENUS.TREE_VIEWER',
    'FS',
    'oracle.apps.fnd.functionSecurity.client.FunctionTreeViewer',
    l_list_id);
    Do you know what 'FS' means ?
    Thank you very much in advance!
    It is my first time to use Java Bean in Oracle Applications!

    HI srini ,
    my application version 12.0.4 and database is 10.2.0.4
    and i want to restrict the No of users
    exp i have have 500 users and i want restrict to 100 only
    how can i do that please explain
    Thanks,
    Sudheer

  • How to use java in Form 9i

    hi
    i want to ask how to use java in form 9i, can any one plz. give me an example
    thanks & best regards!
    SoftDesire

    From an earlier posting:
    "Have a look in the online help for "Java Importer", PJC and "Java Bean".
    There are also some paper on otn.oracle.com/products/forms
    Click to view the papers and you will see a couple which should how to integrate Forms and Java.
    Hope this helps.
    Grant Ronald
    Forms Product Management"
    HOpe this helps.
    Grant

  • How to use Java as a Front-end app

    how java application can be used as the Front-end interfaces to Forte based
    applications???
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Rajiv,
    If you have Forte's WebEnterprise product, and Forte version 3.0.G.x or
    later, you have the ability to export an IIOP interface for any Forte
    service object. In fact, you can go one step further and generate a Java
    interface that "hides" the IIOP issues from the developer. The way you do
    this is to do the following:
    1) From the partitioning workshop, double click on the service object you
    wish to expose as an IIOP interface. This will bring up the Service Object
    Properties dialog.
    2) Off the Export tab, set the External Type drop down to IIOP. If IIOP is
    not an available option in the drop down list then you do not have
    WebEnterprise install.
    3) From here you need to set up the necessary IIOP configuration parameters
    (see the documentation for details on the specifics of what the parameters
    control).
    4) If you want to have Forte generate a JavaBean interface and the necessary
    Java classes to be called by your application then make sure you select the
    Java parameter at the bottom of the Configuration dialog. If IDL is
    selected then Forte will generate a generic IDL interface.
    5) When you make your distribution Forte will generate the Java classes for
    you.
    This mechanism works very well for accessing a Forte service object from a
    Java application.
    Good Luck!
    Jeff Wille
    -----Original Message-----
    From: Rajiv Srivastava <[email protected]>
    To: [email protected] <[email protected]>
    Date: Wednesday, December 09, 1998 2:03 PM
    Subject: how to use Java as a Front-end app
    how java application can be used as the Front-end interfaces to Forte based
    applications???
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • HT1695 I know nothing about how to use my new ipod and when reading the little bit of information in the folder that came with it, all I can do is turn it on, but it just powers down after a few seconds.  How do I work this thing?

    I know nothing about how to use my new ipod and when reading the little information that came with it, all I can do is turn it on.  Then in a few seconds it goes black, never having brought up a screen to do anything!  Help!  What do I do to get this thing going?

    You might consider connecting it to the charger and charging up the battery overnight.
    Please Get the iPod Touch User Manual for iOS 5

  • How to use unicode fonts in Oracle forms 10g?

    Hi I am working in forms 10g for quite a long time, the software that I have developed so far are all in English language. Now I have requirements to use Bengali Fonts in Forms 10g. I am facing difficulties doing that. Please reply with help. Thanks
    Hasan Al Mamun

    Check this forum post (though that is for 6i, it would be of helpful for you)
    How to use unicode fonts in Oracle forms 10g?
    -Arun

Maybe you are looking for

  • Error in starting DB2 UDB (AIX with ECC 6.0)

    Hello All, I am facing error in starting the database as below : <b>exec(): 0509-036 Cannot load program db2start because of the following errors:         0509-130 Symbol resolution failed for /usr/lib/threads/libc.a[aio_64.o] because:         0509-1

  • Bluetooth Keyboard not functioning well when waking from sleep in 10.8

    I've got two different Macs I've recently upgraded to 10.8. Both have wireless keyboards that I use with them. Both keyboards are now having problems when the computer is waking from sleep. Sometimes the keyboard input is very slow (there's a long la

  • Af:panelHeader appearance like in af:panelBox

    Is it possible to let the header of an af:panelHeader appeare like the header of an af:panelBox component? This means that the upper corners should look rounded and the header line should have a colored ramp. I found out, if af:panelHeader components

  • Connexion between Ipad2 and Apple TV

    I try to establish connexion between my Ipad2 and Aplle TV but I'mm not able to receive any picture but only sound ?

  • Sample resumes in SAP XI

    Hi, Could anyone please send me some sample rsumes in WebDynPro and XI. Regards, Ramu