System calls through Java stored Proc

Hi,
Aim: Execute host command from pl/sql thru java stored proc.
1. Created a java class to take system command that could be executed.
2. It runs fine when the class file is executed.
3. when the java file is loaded to database to access it as java stored proc, for any valid and invalid system commands it is giving out 'PL/SQL successfully completed.
Results were not seen.
4. Java source file.
import java.io.*;
import java.lang.*;
public class Util extends Object
public static int RunThis(String[] args) {
Runtime rt = Runtime.getRuntime();
int rc = -1;
String s = null;
try
Process p = rt.exec(args);
BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
// read the output from the command
System.out.println("Here is the standard output of the command:\n");
while ((s = stdInput.readLine()) != null) {
System.out.println(s);
// read any errors from the attempted command
System.out.println("Here is the standard error of the command (if any):\n");
while ((s = stdError.readLine()) != null) {
System.out.println(s);
System.exit(0);
catch (Exception e){
e.printStackTrace();
rc = -1;
finally {
return rc;
public static void main(String[] args){
Util.RunThis(args);
public static String exec(String args){
          Util.RunThis(args);
          return "Srini it is successful";
5. When ran from host prompt (unix),
executed successfully,
$ /opt/java1.3.1/bin/java Util /usr/bin/ls -l
Here is the standard output of the command:
total 30862
-rwxrwxrwx 1 xyz develope 1348218 Jan 2 17:47 02Jan03-2.zip
-rw-r----- 1 xyz develope 21864 Jul 9 2002 109-60_2_modified7.sql
-rw-r----- 1 xyz develope 44934 Jul 9 2002 109-60_2_modified8.sql
Here is the standard error of the command (if any):
xyz@xxxxx:abcd:/home/xyz
$
6. loadjava,
$ loadjava -user username/password Util.java
7. Create proc,
SQL> create procedure echo_input(s1 varchar2) as language java name 'Util.main(java.lang.String[])';
2 /
Procedure created.
8. Execute proc.
SQL> exec echo_input('/usr/bin/ls -l');
PL/SQL procedure successfully completed.
SQL> exec echo_input('/home/o_report/reports/rcli_ASCT &');
PL/SQL procedure successfully completed.
SQL> set serverout on
SQL> exec echo_input('/home/o_report/reports/rcli_ASCT');
PL/SQL procedure successfully completed.
SQL> exec echo_input('ddsafafasf');
PL/SQL procedure successfully completed.
TIA,
Srini.

Hi Srini,
This is just a suggestion, but try entering the following commands (in your SQL*Plus session) before executing your stored procedure:
set serveroutput on size 1000000
exec dbms_java.set_output(1000000)Hope this helps.
Good Luck,
Avi.

Similar Messages

  • Can we call a Java Stored Proc from a PL/SQL stored Proc?

    Hello!
    Do you know how to call a Java Stored Proc from a PL/SQL stored Proc? is it possible? Could you give me an exemple?
    If yes, in that java stored proc, can we do a call to an EJB running in a remote iAS ?
    Thank you!

    For the java stored proc called from pl/sql, the example above that uses dynamic sql should word :
    CREATE OR REPLACE PACKAGE MyPackage AS
    TYPE Ref_Cursor_t IS REF CURSOR;
    FUNCTION get_good_ids RETURN VARCHAR2 ;
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t;
    END MyPackage;
    CREATE OR REPLACE PACKAGE BODY MyPackage AS
    FUNCTION get_good_ids RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'MyServer.getGoodIds() return java.lang.String';
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t
    IS table_cursor Ref_Cursor_t;
    good_ids VARCHAR2(100);
    BEGIN
    good_ids := get_good_ids();
    OPEN table_cursor FOR 'SELECT id, name FROM TableA WHERE id IN ( ' | | good_ids | | ')';
    RETURN table_cursor;
    END;
    END MyPackage;
    public class MyServer{
    public static String getGoodIds() throws SQLException {
    return "1, 3, 6 ";
    null

  • Sqlldr through Java Stored Proc

    I am loading data from sqlldr through a java stored proc that executes command
    strings. My string executes in windows through the command window just fine and I can see the data but If I run the sqlldr through java then I must exit my session and relog in to see the data. Any help is appreciated.
    Thanks, Larry

    I am loading data from sqlldr through a java stored proc Any reason for using java stored proc, instead of directly running sqlldr or using EXTERNAL TABLES?

  • System Call via Java Stored Procedure?

    Within a Java stored procedure I do
    a FTP Call to a remote Server.
    The running FTP Process belongs to
    the Oracle System User (Operating System: Linux).
    Is there a possibility to run that FTP
    call with a different operating system
    user?

    another example of invoking a Java Stored Prodedure from WITHIN a PL/SQL function? What's the issue here? A java stored procedure is a java class wrapped in PL/SQL. Consequently the invocation from with PL/SQL is a straightforward PL/SQL call.
    So what is it that is troubling you?
    Cheers, APC

  • Issuing Solaris system calls through Java

    How can I issue a system call to Solaris using Java? (i.e. Start a script, open a file, and similar)

    Hi Srini,
    This is just a suggestion, but try entering the following commands (in your SQL*Plus session) before executing your stored procedure:
    set serveroutput on size 1000000
    exec dbms_java.set_output(1000000)Hope this helps.
    Good Luck,
    Avi.

  • How to publish a Java Stored proc....

    Hi,
    I wrote the following Java code and loaded it into Oracle 8i, as Java stored procs.
    public class EmployeeStruct
    public int EmployeeNum;
    public String EmployeeName;
    public String Designation;
    and
    import java.sql.*;
    import java.io.*;
    import oracle.jdbc.driver.*;
    public class InsertData
    public static InsertEmployee(EmployeeStruct eps) throws SQLException
    Connection conn =
    DriverManager.getConnection("jdbc:default:connection:");
    String sql = "INSERT INTO EMPLOYEE_TABLE VALUES (?, ?, ?)";
    try
    PreparedStatement pstmt = conn.prepareStatement(sql);
    pstmt.setInt(1, eps.EmployeeNum);
    pstmt.setString(2, eps.EmployeeName);
    pstmt.setString(3, eps.Designation);
    pstmt.executeUpdate();
    pstmt.close();
    catch (SQLException e)
    System.out.println(e.getMessage());
    My question is how do I publish the InsertData proc. I tried :
    CREATE OR REPLACE PROCEDURE insert_data (e EMPLOYEESTRUCT) AS LANGUAGE JAVA
    NAME 'INSERTDATA(EmployeeStruct)';
    but this gives me PLS-00201, identifier EmployeeStruct must be declared.
    COULD SOMEONE HELP ME/ SHOW ME HOW ?
    I wish to call the java stored proc from an external java program.
    rgds
    Jeevan S
    null

    You can't pass Java classes to Java Stored Procedures via the PL/SQL wrapper. You'll have to write your wrapper to take the int as a NUMBER and the two Strings separately as VARCHAR2s, e.g.:
    CREATE OR REPLACE PROCEDURE insert_data
    EmployeeNum IN NUMBER,
    EmployeeName IN VARCHAR2,
    Designation IN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'InsertData.InsertEmployee(int, java.lang.String, java.lang.String)';
    John H.
    null

  • JNDI lookup from a Java stored proc?

    Anybody know if a JNDI lookup, or accessing an EJB from a Java stored procedure is possible? I looked through all the docs and it says it is possible but doesn't specify how. In the java class thats resolved through the stored proc, how are the server generated classes and interfaces made available? Normally setting the classpath for the client app that does the lookup accomplishes this, but what if its called through the stored proc?

    check the rdbms platform's "javavm" folder for a "readme.txt" file ...
    In section 3.16.9, it discusses how to do this ...

  • Spring/Hibernate tier called from Java Stored Procedure

    Here is my scenario.
    Building out a new physical model alongside an old db.
    Two schema's inside same Oracle instance.
    We are building a new Java tier on top of the new schema using spring/hibernate.
    To maintain sync with the old db we are building a load of PLSQL code that will be called by PLSQL stored procs on the old schema.
    ====
    Now it occurred to me that if I could put a copy of my new java tier in the database itself then the trigger code on the old schema could call a java stored proc wrapper which in turn called into my new java tier inside the instance.
    This way I avoid duplication business logic in the db sync and the java middle tier. Basically I do away with the PLSQL sync code and just use the new java component.
    This clearly has advantages from an automated testing point of view too.
    So very interested in how/if anyone has made this work.
    Potential issues...
    - JVM version (outside the db we use Sun Java 5 - inside the db I'm not sure what is used).
    - How would spring access it's config files?

    user563578,
    You asked:
    interested in how/if anyone has made this workNot me.
    You also asked:
    Potential issues...
    - JVM version (outside db use Sun Java 5 - inside db not sure)
    - How would spring access it's config files?
    Oracle has its own JVM embedded in the database: OJVM
    In Oracle 8i it is compatible with JDK 1.2
    In Oracle 9i it is comaptible with JDK 1.3
    In Oracle 10g it is compatible with JDK 1.4
    You can access files outside of the database from OJVM, you just need to set correct permissions.
    Perhaps Kuassi Mensah's book, Oracle Database Programming Using Java and Web Services will be of help?
    Good Luck,
    Avi.

  • Calling a COBOL stored proc from Java Servlet

    I am trying to call a COBOL stored proc from a Java Servlet. The stored proc is stored on a DB2 database. I need to send 6 inputs to the COBOL stored proc and the output will be the return code of the stored proc. I'm not sure if I'm going about this the right way. This is how my code looks...
    public int callStoredProc(CallableStatement cstmt,
    Connection con,
    String sYear,
    String sReportNbr,
    String sSystemCode,
    String sUserId,
    String sModuleNbr,
    String sFormId){
    int iParm1 = 0;
    try{
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    catch(ClassNotFoundException ex){
    System.out.println("Failed to locate database driver: "
    + ex.toString());
    return iParm1;
    try{
    cstmt = con.prepareCall("{? = CALL MKTPZ90C
    cstmt.registerOutParameter(1, Types.INTEGER);
    cstmt.setString(2, sYear);
    cstmt.setString(3, sReportNbr);
    cstmt.setString(4, sSystemCode);
    cstmt.setString(5, sUserId);
    cstmt.setString(6, sModuleNbr);
    cstmt.setString(7, sFormId);
    cstmt.execute();
    iParm1 = cstmt.getInt(1);
    CloseSQLStatement(cstmt);
    catch(SQLException ex) {
    CloseSQLStatement(cstmt);
    System.out.println("SQL exception occurred:" +
    ex.toString());
    return iParm1;
    return iParm1;
    Could someone tell me if this is the right way to go about doing this?
    Thanks!!!!!!

    I didn't see the code where you create the database connection (variable "con"). However, the answer to your question "Is this the right way...", for me, is "Anything that works is the right way." So try it. That's a first approximation, but once you have something that works you can start on improving it, if that becomes necessary.

  • Calling an EJB deployed in OC4J from Java Stored Proc in Oracle

    Hello!
    Trying to make a call to an EJB deployed in OCJ4 from a oracle java stored proc. After loaded orion.jar and crimson.jar lib into SCOTT schema, I can't get the JNDI Context working because of this error:
    ============================================
    javax.naming.NoInitialContextException: Cannot instantiate class:
    com.evermind.server.ApplicationClientInitialContextFactory. Root exception is
    java.lang.ClassNotFoundException:
    com/evermind/server/ApplicationClientInitialContextFactory
    at java.lang.Class.forName0(Class.java)
    at java.lang.Class.forName(Class.java)
    at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:45)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java)
    at javax.naming.InitialContext.init(InitialContext.java)
    at javax.naming.InitialContext.<init>(InitialContext.java)
    ===============================
    I did load the java with "loadjava" with on time with the "resolve" option and time time no option and still no working.
    Here is the EJB client code:
    =======================================
    import java.sql.*;
    import java.util.*;
    import javax.naming.*;
    import com.evermind.server.ApplicationClientInitialContextFactory;
    class EmpRemoteCall {
    public static void main(String[] args) {
    System.out.println(getEmpName());
    public static String getEmpName() {
    String ejbUrl = "java:comp/env/ejb/Emp";
    String username = "admin";
    String password = "admin";
    Hashtable environment = new Hashtable();
    environment.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
    environment.put(Context.PROVIDER_URL, "ormi://127.0.0.1/testemp");
    environment.put(Context.SECURITY_PRINCIPAL, username);
    environment.put(Context.SECURITY_CREDENTIALS, password);
    //environment.put(Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
    //environment.put(javax.naming.Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    com.kboum.sertir.essais.EmpHome homeInterface = null;
    try {
    Class.forName("com.evermind.server.ApplicationClientInitialContextFactory", true, ClassLoader.getSystemClassLoader());
    System.out.println("Creating an initial context");
    Context ic = new InitialContext(environment);
    System.out.println("Looking for the EJB published as 'java:comp/env/ejb/Emp'");
    homeInterface = (com.kboum.sertir.essais.EmpHome) ic.lookup(ejbUrl);
    catch (CommunicationException e) {
    System.out.println("Unable to connect: " + ejbUrl);
    e.printStackTrace();
    //System.exit(1);
    catch (NamingException e) {
    System.out.println("Exception occurred!");
    System.out.println("Cause: This may be an unknown URL, or some" +
    " classes required by the EJB are missing from your classpath.");
    System.out.println("Suggestion: Check the components of the URL," +
    " and make sure your project includes a library containing the" +
    " EJB .jar files generated by the deployment utility.");
    e.printStackTrace();
    //System.exit(1);
    catch (ClassNotFoundException e) {
    System.out.println("Unable to connect: " + ejbUrl);
    e.printStackTrace();
    //System.exit(1);
    try {
    System.out.println("Creating a new EJB instance");
    com.kboum.sertir.essais.Emp remoteInterface = homeInterface.findByPrimaryKey(Integer.valueOf("7369"));
    System.out.println(remoteInterface.getENAME());
    System.out.println(remoteInterface.getSAL());
    remoteInterface.setSAL(2);
    System.out.println(remoteInterface.getSAL());
    return remoteInterface.getENAME();
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    return "error";
    null

    What I did to solve this problem was to
    create a simple RMI remote object that
    resides outside the database JVM and that
    serves as a proxy EJB client for your java
    stored procedure. The stored procedure can
    invoke a method on the remote RMI object
    which then looks up the EJBean's home
    interface and invokes the relevant method on
    the bean's remote interface, and relays any
    return values back to the java stored
    procedure.
    Hope this helps,
    Avi.
    null

  • ORA-03113 error when running the Java stored proc demos

    Hi there,
    Has anyone else run into this issue. When attempting to transfer an object type from Java to Oracle - through a Java stored proc - the session crashes with:
    ORA-03113: end-of-file on communication channelLooking in the trace file generated the error message looks something like:
    ksedmp: internal or fatal error
    ORA-07445: exception encountered: core dump [0x8fe04468] [SIGTRAP] [unknown code] [0x8FE59034] [] []
    Current SQL statement for this session:
    select pointruntime.jdistance(point(1, 2), point(2, 3)) from dual
    ----- Call Stack Trace -----
    calling              call     entry                argument values in hex     
    location             type     point                (? means dubious value)    
    ksedmp+764           call     ksedst               0 ? 2C4F4A ? 2C ? 98968000 ?
                                                       DB02C ? 27A50000 ?
    ssexhd+956           call     ksedmp               3 ? 0 ? 8FE5E790 ? 5905870 ?
                                                       8FE0434C ? 40895E4 ?
    0x9012c860           call     ssexhd               5 ? BFFEEF70 ? BFFEEFB0 ? 0 ?
                                                       0 ? 0 ?As you can see from the trace snippet above, I was attempting to run one of the Oracle Java stored procedure demos. Has anyone successfully run those demos? Specifically the ones where complex types (table objects or the Point object) are passed back to Oracle from the JVM.
    I would appreciate some help with this. The code works fine in a Windows or Solaris environment but barfs on Apple. Truly annoying....
    Anyone?
    Thanks in advance,
    Alex

    Yes,
    Apologies for not stating that information, Steve. Was a bit naughty of me! I guess the reason I didn't was because I just wanted to hear if anyone else running Oracle on Mac received such errors when executing the Java stored proc demos (specifically, the execution of PointRuntime.jDistance). Nevertheless, here's the relevant info from the trace file:
    Dump file /Users/oracle/admin/sandbox/udump/sandbox_ora_1861.trc
    Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
    ORACLE_HOME = /Users/oracle/product/10.1.0/db
    System name:     Darwin
    Node name:     maczilla.local
    Release:     8.3.0
    Version:     Darwin Kernel Version 8.3.0: Mon Oct  3 20:04:04 PDT 2005; root:xnu-792.6.22.obj~2/RELEASE_PPC
    Machine:     Power Macintosh
    Instance name: sandbox
    Redo thread mounted by this instance: 1
    Oracle process number: 10
    Unix process pid: 1861, image: [email protected] for the Java version, according to the readme file in the javavm directory, I am running 1.4.1:
    1.5  Java Compatibility
    This release has been thoroughly tested with Sun's Java Compatibility
    Kit for the JDK 1.4.1. Oracle is committed to OracleJVM keeping pace
    with Java and other Internet standards.

  • Issue with sending mail through java stored procedure in Oracle

    Hello
    I am using Oracle 9i DB. I created a java stored procedure to send mail using the code given below. The java class works fine standalone. When its run from Java, mail is sent as desired. But when the java stored procedure is called from pl/sql "Must issue a STARTTLS command first" error is thrown. Please let me know if am missing something. Tried the same code in 11.2.0.2 DB and got the same error
    Error:
    javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command first. va6sm31201010igc.6
    Code for creating java stored procedure: (T1 is the table created for debugging)
    ==================================================
    create or replace and compile java source named "MailUtil1" AS
    import java.util.Enumeration;
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    public class MailUtil1 {
    public static void sendMailwithSTARTTLS(String host, //smtp.projectp.com
    String from, //sender mail id
    String fromPwd,//sender mail pwd
    String port,//587
    String to,//recepient email ids
    String cc,
    String subject,
    String messageBody) {
    try{
    Properties props = System.getProperties();
    props.put("mail.smtp.starttls.enable", "True"); // added this line
    props.put("mail.smtp.host", host);
    props.put("mail.smtp.user", from);
    props.put("mail.smtp.password", fromPwd);
    props.put("mail.smtp.port", port);
    props.put("mail.smtp.auth", "true");
    #sql { insert into t1 (c1) values ('1'||:host)};
    Session session = Session.getDefaultInstance(props, null);
    MimeMessage message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));
    #sql { insert into t1 (c1) values ('2')};
    InternetAddress[] toAddress = new InternetAddress[1];
    // To get the array of addresses
    for( int i=0; i < toAddress.length; i++ ) { // changed from a while loop
    toAddress[i] = new InternetAddress(to);
    //System.out.println(Message.RecipientType.TO);
    for( int i=0; i < toAddress.length; i++) { // changed from a while loop
    message.addRecipient(Message.RecipientType.TO, toAddress);
    if (cc!=null) {
    InternetAddress [] ccAddress = new InternetAddress[1];
    for(int j=0;j<ccAddress.length;j++){
    ccAddress[j] = new InternetAddress(cc);
    for (int j=0;j<ccAddress.length;j++){
    message.addRecipient(Message.RecipientType.CC, ccAddress[j]);
    message.setSubject(subject);
    message.setText(messageBody);
    message.saveChanges();
    #sql { insert into t1 (c1) values ('3')};
    Enumeration en = message.getAllHeaderLines();
    String token;
    while(en.hasMoreElements()){
    token ="E:"+en.nextElement().toString();
    #sql { insert into t1 (c1) values (:token)};
    token ="ConTyp:"+message.getContentType();
    #sql { insert into t1 (c1) values (:token)};
    token = "Encod:"+message.getEncoding();
    #sql { insert into t1 (c1) values (:token)};
    token = "Con:"+message.getContent();
    #sql { insert into t1 (c1) values (:token)};
    Transport transport = session.getTransport("smtp");
    #sql { insert into t1 (c1) values ('3.1')};
    transport.connect(host, from, fromPwd);
    #sql { insert into t1 (c1) values ('3.2')};
    transport.sendMessage(message, message.getAllRecipients());
    #sql { insert into t1 (c1) values ('3.3')};
    transport.close();
    #sql { insert into t1 (c1) values ('4')};
    catch(Exception e){
    e.printStackTrace();
    String ex= e.toString();
    try{
    #sql { insert into t1 (c1) values (:ex)};
    catch(Exception e1)
    Edited by: user12050615 on Jan 16, 2012 12:18 AM

    Hello,
    Thanks for the reply. Actually I have seen that post before creating this thread. I thought that I could make use of java mail to work around this problem. I created a java class that succesfully sends mail to SSL host. I tried to call this java class from pl-sql through java stored procedure. That did not work
    So, is this not supported in Oracle ? Please note that I have tested this in both 9i and 11g , in both the versions I got the error. You can refer to the code in the above post.
    Thanks
    Srikanth
    Edited by: user12050615 on Jan 16, 2012 12:17 AM

  • Java Stored Proc Enum Failure

    Is there a problem with all enums called from Java stored procedures? Has anyone gotten this to work?
    Here is the enum:
    public enum OscarType
         BreadthFirst,
         DepthFirst;
         public static String hello(){
              return "hello";     
    The client is running jdk 1.6_04. The server is running jdk 1.6_13. We have tried compiling client side and server side. It results in the same error.
    Invoking a stored proc that calls the static method hello results in:
    Error report:
    ORA-29516: Aurora assertion failure: Assertion failure at eox.c:342
    Uncaught exception System error: java/lang/UnsupportedClassVersionError
    ORA-06512: at "TLMDEV.TESTJAVASTOREDPROCMERGE", line 1
    ORA-06512: at line 8
    29516. 00000 - "Aurora assertion failure: %s"
    *Cause:    An internal error occurred in the Aurora module.
    *Action:   Contact Oracle Worldwide Support.
    The following query shows the JAVA CLASS OscarType to have a status of VALID.
    SELECT status,object_type,dbms_java.longname(object_name) FROM user_objects
    WHERE object_type IN ('JAVA SOURCE', 'JAVA CLASS', 'JAVA RESOURCE')
    and dbms_java.longname(object_name)='OscarType';

    Wrong version of Java. 1.6. was not installed on the server. Issue resolved.

  • How to pass a refcursor to a java stored proc

    Hi all,
    Please forgive me as I am new to Java and JDeveloper....
    I want to pass a refcursor to a java stored proc. Does anyone know how to accomplish this?
    Thanks,
    dayneo

    Hi,
    As Avi has indicated, you can map ref cursor to java.sql.ResultSet
    here are Call Specs and a code snippet from chapter 3 in my book.
    procedure rcproc(rc OUT EmpCurTyp)
    as language java
    name 'refcur.refcurproc(java.sql.ResultSet[])';
    function rcfunc return EmpCurTyp
    as language java
    name 'refcur.refcurfunc() returns java.sql.ResultSet';
    * Function returning a REF CURSOR
    public static ResultSet refcurfunc () throws SQLException
    Connection conn = null;
    conn = DriverManager.getConnection("jdbc:oracle:kprb:");
    ((OracleConnection)conn).setCreateStatementAsRefCursor(true);
    Statement stmt = conn.createStatement();
    ((OracleStatement)stmt).setRowPrefetch(1);
    ResultSet rset = stmt.executeQuery("select * from EMP order by empno");
    // fetch one row
    if (rset.next())
    System.out.println("Ename = " + rset.getString(2));
    return rset;
    Kuassi

  • How to change system time through java program

    Hi
    I want to know, how to change system time through java program.
    give me a idia with example.
    Thanks

    There isn't any core Java API for this. Use JNI or call an external process with Runtime.exec().
    ~

Maybe you are looking for

  • Timerjob is not working - it doesn't show up in central admin monitoring tab

    Dear all, I have enabled the timer job using the following class file and event receiver file. After enabling in powershell - the job is not appearing in job definition in central administration. Any inputs are highly appreciated. Since I am new to S

  • Why is it such a pain to create playlists?

    On the mac you can use commandshiftN to create a playlist from a selection, but for some reason there's no shortcut for this on the pc, and it's a pain. I transfered all my music to my PC b/c it's better than my aging powerbook, but I was too lazy to

  • XDP - open PDF with #toolbar=0 problem in IE

    Hi When opening PDF's using a correctly constructed XDP I specify at the end: <pdf href="some.pdf" xmlns=http://ns.adobe.com/xdp/pdf/ /> Everything works correctly in all browsers. I would like to hide the toolbars so when I change the href to: <pdf

  • User Creation in EP 7 - Help Needed.

    Hi Guys, We have installed an EP 7, I would like create users in EP 7 Database. My Data Source configuration file dataSourceConfiguration_abap.xml. I have installed a WAS 6.40 JAVA + ABAP This means I have to create the user in ABAP, I would like to

  • After updates photo to get new albums that cant be deleted

    in my iphone 4 i have new photo library & Camera Roll how can i move photo from photo library back to camera roll & delete the photo library?