Oracle PL/SQL Obfuscation replicate 3DES with java

I have an existing oracle functions that use the function DES3Encrypt and DES3Decrypt.

I need to write the equivalent of java version to replace the oracle those compatibiliy with encryption legacy system maintenance.

What are the functions of oracle:

FUNCTION encr(input_string IN VARCHAR2, key_string IN VARCHAR2)
  RETURN VARCHAR2 IS
  encrypted_string
:= NULL;
  len 
:= lengthb(input_string);
  
--String must be a multiple of 8-byte length.
  rest
:= len MOD 8;
  IF rest
> 0 THEN
  decrypted_string
:= rpad(input_string, len + 8 - rest, ' ');
  ELSE
  decrypted_string
:= input_string;
  
END IF;

  dbms_obfuscation_toolkit
.DES3Encrypt(input_string  => decrypted_string,
  key_string 
=> key_string,
  encrypted_string
=> encrypted_string);

  
/* HEX notation to avoid UNICODE chars */
  SELECT RAWTOHEX
(encrypted_string) INTO encrypted_string FROM DUAL;

  RETURN encrypted_string
;
END;

//DECRYPTION
FUNCTION decr
(input_string IN VARCHAR2, key_string IN VARCHAR2)
  RETURN VARCHAR2 IS
  decrypted_string
:= NULL;
  encrypted_string
:= input_string;

  
/* HEX to ASCII */
  SELECT utl_raw
.cast_to_varchar2(encrypted_string)
  INTO encrypted_string
  FROM DUAL
;

  dbms_obfuscation_toolkit
.DES3Decrypt(input_string  => encrypted_string,
  key_string 
=> key_string,
  decrypted_string
=> decrypted_string);

  RETURN rtrim
(decrypted_string);
END;

Given the Decrypt function, for example, I wrote this java code:


import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;


public class DesHelper {
  

   private Cipher _dcipher;
      
public DesHelper() {
          
try {

              
byte[] tdesKey = new byte[24];
              
System.arraycopy("2557133392096270".getBytes(StandardCharsets.US_ASCII), 0, tdesKey, 0, 16);
              
System.arraycopy("2557133392096270".getBytes(StandardCharsets.US_ASCII), 0, tdesKey, 16, 8);

              
final SecretKey key = new SecretKeySpec(tdesKey, "DESede");
 

               _dcipher
= Cipher.getInstance("DESede/CBC/NoPadding");
              
final IvParameterSpec iv = new IvParameterSpec(new byte[8]);

               _dcipher
.init(Cipher.DECRYPT_MODE, key,iv);

         
} catch (final Exception e) {
             
throw new RuntimeException(e);
         
}
      }


      public String decrypt(final String str) {
         
try {

              final byte[] dec1 = hexToBytes(str);
             
final byte[] decryptedBytes = _dcipher.doFinal(dec1);  
             
return new String(decryptedBytes, StandardCharacters.US_ASCII);
         
} catch (final Exception e) {
             
System.out.println("decrypting string failed: " + str + " (" + e.getMessage() + ")");
             
return null;
         
}
      }

     private static byte[] hexToBytes(final String hex) {
         
final byte[] bytes = new byte[hex.length() / 2];
         
for (int i = 0; i < bytes.length; i++) {
              bytes
[i] = (byte) Integer.parseInt(hex.substring(i * 2, i * 2 + 2), 16);
         
}
         
return bytes;
     }

}

It's the main:

Public class MainClass {}

Public Shared Sub main (final String [] args) {}

String txtToBeDecrypted = "DA67C73756184F20ED92DF1614CB85ED";

final DesHelper h = new DesHelper();

String xc = h.decrypt (txtToBeDecrypted);

System.out.printls (XC);

}

}


But the printed result is still a mess of characters like these:

lZ5 ????rd      

where only "rd" is correct (being the last part of the decrypted Word).

the correct decrypted word should be 'MonMotpasse '.

If the password is transformed into mypasswordmypass (encrypted: 5543417F4834268A2799D9289D864BFB)... I get: lZ5? rdmypass-> it seems that the first 64 bits are always false.

What is the problem in my code? is it just a matter of encoding?

Message modificato da 3136775 added new snippet for completeness

I found that the tip is in the vector of inialization IV...

I wrote an algorithm to capture the right bytes value and it worked... it seems not oracle uses to manipulate the first 8 bytes.

Tags: Database

Similar Questions

  • 4.1 Why complain with java version 1.8.0_31?

    Hi all

    Decided to share this, as it seems a little strange to me, and Googling for this error does not return useful results.

    objective: installation of the sql 4.1 with jdk 1.8 developer

    EDIT: adding download links

    1. downloaded: jdk-8u31-windows - x 64 .exe [a Java SE Development Kit 8 - downloads - Windows x 64 - http://download.oracle.com/otn-pub/java/jdk/8u31-b13/jdk-8u31-windows-x64.exe ]

    2. downloaded: sqldeveloper - 4.1.0.17.29 - no - jre.zip [a SQL Developer 4.1 early adopter -Windows 32/64 - bit - http://download.oracle.com/otn/java/sqldeveloper/sqldeveloper-4.1.0.17.29-no-jre.zip ]

    3 extracts sqldeveloper - 4.1.0.17.29 - no - jre.zip in the folder xpto

    4. run sqldeveloper.exe and set the folder of jdk for the installation of step1 folder got - it's C:\Program Files\Java\jdk1.8.0_31

    5 WARNING strange message complaining that sql developer oracle 4.1 not been certified with java 1.8.0_31! Seriously ?

    sqldeveloepr4.1--java1.8 error.png

    The PC is not mine, and I noted several java.exe in certain directories to spread with no set env vars. Anyway the only thing I think is important for sql developer is the physical path that we provide, so im really puzzled why the oracle Web site recommends version of the jdk for oracle sql developer 4.1 1.8 is rejected when I try to install it

    See you soon,.

    Zen

    because, bug

    We forgot to set a flag in the generation process which would ensure that it is looking for 8

    You want to, must have JDK8 with v4.1

    Just say 'Yes' and continue.

    This bug has been fixed for the next early adopter.

  • problem with Java mail for oracle 9i

    Hi all
    I want to send messages from the oracle 9i server to my mail server (mail.example.com).
    Please see this link * [http://www.akadia.com/services/java_mail_plsql.htmlbold] * and I try to follow their guidelines.
    Everything is running successfully. The part where it's written on this document "Install Java Code to send emails with attachments. When try to run this code as scott/tiger schema, then I got an error which is in the below:

    ATTENTION: Java created with compilation errors.

    After the words when I ran to see what the problem with the execution of this order "display errors java source 'SendMail'" it's generating error information below:

    error starting
    JAVA SOURCE SendMail errors:

    LINE/COL ERROR
    -----------------------------------------------------------------
    0/0 SendMail:25: class Session not found.
    0/0 SendMail:25: class Session not found.
    0/0 SendMail:25: name of variable or class not defined: Session
    SendMail:29 0/0: MimeMessage class not found.
    SendMail:29 0/0: MimeMessage class not found.
    SendMail:34 0/0: InternetAddress class not found.
    SendMail:34 0/0: InternetAddress class not found.
    SendMail:34 0/0: Undefined variable or class name: InternetAddress
    SendMail:41 0/0: InternetAddress class not found.
    SendMail:41 0/0: InternetAddress class not found.
    SendMail:41 0/0: Undefined variable or class name: InternetAddress

    LINE/COL ERROR
    -----------------------------------------------------------------
    SendMail:48 0/0: InternetAddress class not found.
    SendMail:48 0/0: InternetAddress class not found.
    SendMail:48 0/0: Undefined variable or class name: InternetAddress
    SendMail:55 0/0: InternetAddress class not found.
    SendMail:55 0/0: InternetAddress class not found.
    SendMail:55 0/0: Undefined variable or class name: InternetAddress
    SendMail:60 0/0: msg Variable may not have been initialized.
    SendMail:63 0/0: Multipart class not found.
    0/0 SendMail:63: class not found MimeMultipart.
    SendMail:67 0/0: MimeBodyPart class not found.
    SendMail:67 0/0: MimeBodyPart class not found.

    LINE/COL ERROR
    -----------------------------------------------------------------
    SendMail:79 0/0: MimeBodyPart class not found.
    SendMail:79 0/0: MimeBodyPart class not found.
    SendMail:80 0/0: Class FileDataSource not found.
    SendMail:81 0/0: Class FileDataSource not found.
    SendMail:90 0/0: MimeBodyPart class not found.
    SendMail:90 0/0: MimeBodyPart class not found.
    SendMail:91 0/0: Class FileDataSource not found.
    SendMail:91 0/0: Class FileDataSource not found.
    SendMail:99 0/0: msg Variable may not have been initialized.
    0/0 SendMail:105: name of variable or class not defined: Transport
    SendMail:106 0/0: MessagingException class not found.

    LINE/COL ERROR
    -----------------------------------------------------------------
    0/0 info: 33 errors
    end error

    Even if I try to compile the source file java Oracle database 9i «schema-> Scott-> Source types-> Java Sources»
    But could not compile. There show "status as invalid.

    Please help me

    Published by: André on June 4, 2010 20:21

    Published by: André on June 4, 2010 20:22

    Published by: André on June 4, 2010 20:23

    is there a reason why you need to use JAVA for this? Oracle email can be easily done using UTL_SMTP - I've been using this package for years with great success http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/maildemo_sql.txt - running like a charm 9.2

  • Developer SQL release 4 (Windows XP, Java)

    As far as I know, my personal computer environment has the following attributes:

    Windows XP

    32 bit processor

    applications that require Java 6 (jre) or less

    I would use SQL developer version 4 in the same environment that requires Java 7 development kit.

    Is there a way to 'best practices' to download the 7 Java SDK in an environment similar to that described above

    so it can peacefully coexist with Java 6, but only used by SQL Developer release 4. I realize that some downloads account

    SQL Developer already include the appropriate Java components, but I don't think that this applies to my situation.

    Hello

    Is there a way to 'best practices' to download the Java 7 SDK so that it can coexist peacefully with Java 6...

    It's easy!  Most applications use only a JRE, not a JDK and search for it through the system to the Windows PATH environment variable.  Only Java JDK Installer installs a JRE optionally and under Win XP 32-bit, will put the copies under C:\Program Java and C:\Windows\System32.  Path must always include C:\Windows\System32, but generally should not include a specific reference to a under C:\Program Java JRE or a JDK.

    So...

    1. download the latest version of Windows x 86 Java JDK 7 of Java SE Development Kit 7 - downloads | Oracle Technology Network | Oracle

    2. run. During the installation, select only the development tools option, making sure to deselect the Source Code and JRE Public.

    3. download the Windows 32/64 - bit announcement this forum > view details > download.

    4. run and install it according to the usual instructions (unzip into an empty directory, etc.).

    5. the product must ask the location of the JDK.  You will probably choose something like C:\Program Files\Java\jdk1.7.0_55.

    6. If no prompt, or you choose the wrong JDK, just manually edit the SetJavaHome line in the sqldeveloper\...\product.conf file.

    7. which should be found at the location of your user AppData.  For Win XP: C:\Documents and Settings\Change Data

    Kind regards

    Gary

    SQL development team

    Post edited by: Gary Graham Added back some dropped lines.

  • Need help to write to Oracle and SQL Server in the Oracle triggering

    We have a third which feeds data for us. Their client application feeds directly to some source tables in our Oracle database 10g. We have triggers on those tables that sort and treat lines as they come.

    We have a new operation and try to write some of these incoming data now to a SQL Server database through heterogeneous services - essentially the same exact data in two databases. I have a related database that works very well for the selection, but I've never tried to write Oracle PL/SQL to write in a DB SQL Server 2008. My first attempt was met with the following error: "ORA-02047: impossible to join the current distributed transaction.

    I found another thread where they say that the only way to do it is by using a stand-alone transaction, but they do not give an example. Here is the section of relaxation that I use:
      select to_char(new_date,'MM-DD-YYYY') into sql_txt from dual;
      insert into mancamp_location@sqlweb
           ("UnitID", "ManCampID", "Lat", "Long", "UpdateDT", "VehSpeed", "VehDirection", "Landmark")
        values (v_truck, f_unit, f_lat, f_long, sql_txt, f_spd, f_dir, f_ldmk);
    Can someone point me to a way to accomplish this simple insertion?

    An example of a standalone trigger is:

    Suppose you have a table in Oracle:

    CREATE TABLE emp_sal
    (
    EMPNO NUMBER 4,
    SAL NUMBER (7.2));

    and a similar table in a SQL server:
    SQL Server:

    CREATE TABLE emp_sal
    (
    EMPNO NUMERIC (4).
    SAL NUMERIC (7.2));

    Then, you can create an insert trigger that replicates the data:
    CREATE OR REPLACE TRIGGER dg4odbc_repl AFTER INSERT ON emp_sal
    FOR EACH LINE
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    INSERT INTO 'emp_sal"@MSODBCSQLSERVER_DG4ODBC_EMGTW_1123_DB '.
    VALUES (: new.empno,: new.sal);
    COMMIT;
    END;
    /

    -Note the validation, otherwise risk of ORA-6519

    When you now insert a record into the Oracle database:
    insert into emp_sal values (1234, '1200,89');
    the trigger is activated and inserts the record in SQL Server:
    Select * from 'emp_sal"@MSODBCSQLSERVER_DG4ODBC_EMGTW_1123_DB;
    EMPNO, SAL
    ----- -------
    1234 1200.89

    It works fine when you post data insert, but as soon as restore you the insert only data Oracle will be cancelled - data will remain as long as the independent transaction dedicated to its SQL Server insert:

    insert into emp_sal values (1384, '1200,89');
    Rollback;
    Select * from emp_sal;
    EMPNO, SAL
    ----- -------
    1234 1200.89

    Select * from 'emp_sal"@MSODBCSQLSERVER_DG4ODBC_EMGTW_1123_DB;
    EMPNO, SAL
    ----- -------
    1234 1200.89
    1384 1200.89

    So I strongly recommend to use the DG4MSQL gateway which is able to participate in distributed transactions and allows validation/restore transactions.

    DG4ODBC lie on OTN (http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html-online check out the "See all" link for your favorite platform), cloud of delivery of software Oracle (https://edelivery.oracle.com/) or "My Oracle Support". My Oracle support welcomes the latest version 11.2.0.3. In My Oracle Support goto patches and updates, then search for 11.2.0.3 data set Patch 10404530patch: 11.2.0.3.0 PATCH SET for ORACLE database SERVER, choose your preferred platform and see the Readme which CD contains the gateway software.

    Published by: kgronau on April 24, 2012 08:44

  • XLIFF file format and use with JAVA API

    Hello

    We use BEEP version 5.6.3 in Oracle Applications 11.5.10.2 and we are developing some reports to be translated into 10 different languages. We are therefore very interested in XLIFF files but have some questions about the file format and the use of the JAVA API

    (A) FILE FORMAT
    Accuracy: we generate the XLF file in menu add-on BEEP in Winword MS used to build the RTF model
    (A - 1), the generated XLF file begins with:
    <? XML version = "1.0" encoding = "utf - 8"? >
    Can we change encoding to "ISO-8859-1' as soon as convert us the file format?

    A-2) section he < header > < skl > < file > internal - contains a huge chain that seeem to be binary... What is c? can delete us it?

    A-3) can you have a file XLF muliple < file > sections (one for each language translation)?
    This can be very useful for us to manage a translation only by a report model file.

    A-4) the most important section for translation is included in the tag < trans-unit >.
    Each of them has a separate as id "49e41f8f" '... '. Can we replace that with a larger significance?

    (A - 5) in the format of language is as "en-US" (area code + language code).
    It is case sensitive?

    (* B) THE USE OF XLIFF FILES WITH JAVA APIS *.
    We use the OPE "FOProcessor" class to generate the PDF providing:
    -Data generated by SQL report XML file
    -File XSL - FO, generated from the module BEEP in MS WINWORD RTF model
    -XLIFF file generated from RTF model by the module BEEP in MS WINWORD
    -The XLIFF file contains a file entry to translate the form English to French
    < file source = target language language "en-US" = "en - US" datatype = "OPE" original = "orphan.xlf" product-version = "orphan.xlf" - name of the product ="" > "

    Here is a summary of our java implementation class:

    Processor FOProcessor = new FOProcessor();
    processor.setData (sXmlDataFilepath);
    processor.setTemplate (sXslTemplateFilepath);
    processor.setOutput (sPdfOutputFilepath);
    processor.setOutputFormat (FOProcessor.FORMAT_PDF);
    processor.setLocale ("en - US");
    xInputXlfLang = new FileInputStream (sXlfLangFilepath);
    processor.setXLIFF (xInputXlfLang);
    try {}
    Processor.Generate ();
    }
    {} catch (XDOException e)
    e.printStackTrace ();
    }


    (variables beginning with "s" are path + names passed as arguments)


    The output PDF file is well generated, but not translated in French!

    (1) I missed something?
    What is wrong in my code or my XLIFF file?
    Y at - it a parameter to pass to allow the XLIFF translation (via setConfig)?
    With "setLocale" we indicate the target language, but how BEEP knows this current language is "en-US"?

    I found a few posts on the subject, but none with a clear solution. So if I managed to solve this problem, I think it can be very useful for many developers.

    Thanks in advance for your help.
    K.Helali

    Edited by: K.Helali Apr 26. 2010 01:56

    Hey,.

    I know what you're talking about.

    Do not make the rtf-> xsl in the office.

    Do it in java code.

    Use RTFprocessor, for her, just set the model and set the true extractxliff.

    move the xsl foprocessor.

    to do this

    (1) in the BEEP for MS Word
    1 - a) build the RTF model
    1-c) extract texts translateable to the XLF file

    (2) in BEEP Server (Linux Redhat, BEEP 5.6.3) included with the Oracle Applications 11.5.102
    (2 - a) write a java class that implements class FOProcessor (see code in my first post)
    I'm passing to the FOProcessor class
    -XML data file
    model model XSL - export RTF, file to the XSL using RTFprocessor file save it sub - (here in rtfprocessor.setextractXlifff - true)
    http://download.Oracle.com/docs/CD/E10415_01/doc/bi.1013/e12693/Oracle/Apps/XDO/template/RTFProcessor.html
    -Translation (via the FOProcessor.setXLIFF method) XLF file

  • Developer SQL 2.1: problem with the dialog box to change the display

    I am running Version 2.1.0.63 on Windows XP SP3.

    When I open an existing view and make changes in the change display dialog box and then click on the button OK the dialog box remains open and the view is not changed.

    This user has Create View privileges and can run CREATE or REPLACE the sql statement to change the view. The same view of edition having the same user works very well in Version 1.5.3.

    Someone else has a similar problem?

    Thank you.

    It's a bug, the following exception is raised:

    Exception occurred during event dispatching:
    oracle.javatools.db.ddl.UnsupportedDDLException: Cannot update VIEW MADREMIA with the given changes using ALTER statements.
            at oracle.javatools.db.ddl.DDLGeneratorImpl.getUpdateDDLImpl(DDLGeneratorImpl.java:480)
            at oracle.javatools.db.ddl.AbstractDDLGenerator.processResultSet(AbstractDDLGenerator.java:148)
            at oracle.javatools.db.ddl.AbstractDDLGenerator.getUpdateDDL(AbstractDDLGenerator.java:110)
            at oracle.javatools.db.ddl.DDLDatabase.appendUpdateDDL(DDLDatabase.java:661)
            at oracle.javatools.db.ddl.DDLDatabase.updateObjects(DDLDatabase.java:556)
            at oracle.ide.db.dialogs.CascadeConfirmDialog.updateObjects(CascadeConfirmDialog.java:111)
            at oracle.ide.db.panels.TabbedEditorPanel.commitToProvider(TabbedEditorPanel.java:357)
            at oracle.ide.db.panels.TabbedEditorPanel.onExit(TabbedEditorPanel.java:246)
            at oracle.ideimpl.db.panels.TraversableProxy.onExit(TraversableProxy.java:62)
            at oracle.ide.panels.TDialog$L.vetoableChange(TDialog.java:104)
            at java.beans.VetoableChangeSupport.fireVetoableChange(VetoableChangeSupport.java:335)
            at java.beans.VetoableChangeSupport.fireVetoableChange(VetoableChangeSupport.java:252)
            at oracle.bali.ewt.dialog.JEWTDialog.fireVetoableChange(JEWTDialog.java:1472)
            at oracle.bali.ewt.dialog.JEWTDialog.dismissDialog(JEWTDialog.java:1502)
            at oracle.bali.ewt.dialog.JEWTDialog$UIListener.actionPerformed(JEWTDialog.java:1894)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6263)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6028)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4630)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2475)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
            at java.awt.Dialog$1.run(Dialog.java:1045)
            at java.awt.Dialog$3.run(Dialog.java:1097)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.awt.Dialog.show(Dialog.java:1095)
            at java.awt.Component.show(Component.java:1563)
            at java.awt.Component.setVisible(Component.java:1515)
            at java.awt.Window.setVisible(Window.java:841)
            at java.awt.Dialog.setVisible(Dialog.java:985)
            at oracle.bali.ewt.dialog.JEWTDialog.runDialog(JEWTDialog.java:395)
            at oracle.bali.ewt.dialog.JEWTDialog.runDialog(JEWTDialog.java:356)
            at oracle.ide.dialogs.WizardLauncher.runDialog(WizardLauncher.java:55)
            at oracle.ide.panels.TDialogLauncher.showDialog(TDialogLauncher.java:225)
            at oracle.ide.db.dialogs.BaseDBEditorFactory.launchDialog(BaseDBEditorFactory.java:623)
            at oracle.ide.db.dialogs.BaseDBEditorFactory.editDBObject(BaseDBEditorFactory.java:368)
            at oracle.ide.db.dialogs.AbstractDBEditorFactory.editDBObject(AbstractDBEditorFactory.java:332)
            at oracle.ide.db.dialogs.BaseDBEditorFactory.editDBObject(BaseDBEditorFactory.java:54)
            at oracle.ide.db.dialogs.AbstractDBEditorFactory.editDBObject(AbstractDBEditorFactory.java:314)
            at oracle.dbtools.raptor.navigator.DatabaseNavigatorController.editObject(DatabaseNavigatorController.java:470)
            at oracle.dbtools.raptor.navigator.DatabaseNavigatorController.handleEvent(DatabaseNavigatorController.java:308)
            at oracle.ide.controller.IdeAction.performAction(IdeAction.java:531)
            at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:886)
            at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:503)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
            at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
            at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
            at java.awt.Component.processMouseEvent(Component.java:6263)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6028)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4630)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2475)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    

    Bug 9199263 has been filed for this, but apparently it wasn't a showstopper for the production. It may be set in one of the upcoming patches...

    Kind regards
    K.

  • Scheme of Oracle10g with java classes invalid--a need to know the reason

    Dear experts,

    As a newbie, I was presentede with a scheme of database with an invalid object of type CLASS JAVA.

    I need to know why they are not valid. Expected to find information in the USER_OBJECTS. But no information at hand.

    Is there a way to know, why a CLASS JAVA type object is INVALID?

    / Jorn

    Hello

    Use [change java | http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_1010.htm#SQLRF00807]:

    create or replace and compile java source named "brokenJava"
    as
    public class brokenJava {
        public static void test() {
            Properties p = System.getProperties();
        }
    }
      8  /
    
    Warning: Java created with compilation errors.
    
    SQL> alter java class "brokenJava" compile;
    
    Warning: Java altered with compilation errors.
    
    SQL> sho err
    Errors for JAVA CLASS "brokenJava":
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    0/0      ORA-29535: source requires recompilation
    SQL> alter java source "brokenJava" compile;
    
    Warning: Java altered with compilation errors.
    
    SQL> sho err
    Errors for JAVA SOURCE "brokenJava":
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    0/0      brokenJava:3: cannot find symbol
    0/0      symbol  : class Properties
    0/0      1 error
    0/0      Properties p = System.getProperties();
    0/0      ^
    0/0      location: class brokenJava
    
  • When I start my online banking, the options do not load. I get a message that the applet is not started because it has not been initialized (I think it has to do with Java). What should I do?

    I go on my site of the Fund and go to my accounts. And I can get into my account. But the menu that allows you, among other things, go to the online banking is not. Keep it from the page it says "start applet" and then immediately "uninitialized applet." How as it initialized? I think, but am not really sure that it has something to do with Java.

    To see if you need an update to the Java plugin, see the Oracle here test page:

    http://www.Java.com/en/download/testjava.jsp

    Who help me?

  • With the help of EQ with Java 7 Workgroup Manager

    Oracle is declining in favour of Java 6. How can I get Bishop Grp to work with java 7? I have a 5000 PS to fw version 6.02.

    Thank you.

    It's something on the browser side OS.   What browser do you use?  The Web page sees that it is a java applet and call Java Runtime on the host computer.

    I would like to clear the cache from my browser and java and try again.

  • Windows 7 starter edition does not work with Java 7 (unable to load the chat room) how to fix?

    Hello

    I have Windows 7 edition - starter and Java 7 when I try to use a school chatrooom - java won't load properly - tech school says it's because Windows 7 does not support Java 7 - any ideas on how to fix?
    THX,
    Maja

    If he believes that the school needs to get a new technology.

    To check if the problem is that the cat does not work with Java 7, uninstall Java 7 and install Java JRE 6 from here:

    http://www.Oracle.com/technetwork/Java/javase/downloads/index.html

    You must specify the exact error messages see you or post links on the screenshots so that your problem can be better understood.

  • DBD version is compatible with Java 1.6?

    Hello. What last DBD version is compatible with Java 1.6?

    To be clear, you ask about BDB Java Edition (JE), or the original BDB, the C-based product has a Java JNI interface?

    This is the forum of BDB I. The latest version of the EIS supporting Java 6 is I 5.0.x. Java 7 is required for I 6.x and higher.

    Older versions can be downloaded here:

    http://www.Oracle.com/technetwork/database/database-technologies/BerkeleyDB/downloads/index-098622.html

    -mark

  • How to use the nocopy with java stored procedures parameters

    
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    
    

    I'm a PL/SQL programmer, but not a Java programmer. I have the following java function that does what it's supposed to add a pdf at the end of another pdf document:

    import oracle.sql.BLOB;
    import org.apache.pdfbox.util.PDFMergerUtility;
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.driver.OracleDriver;
    import java.io.OutputStream;
    
    public class PDFUtilities {
    public static BLOB appendPDF(BLOB pdfdoc1, BLOB pdfdoc2) throws Exception {
           
            //create a connection object to the current instance
              OracleConnection conn = (OracleConnection)new OracleDriver().defaultConnection();
            //create the output blob using the connection
              BLOB outPDF = BLOB.createTemporary(conn, true ,BLOB.DURATION_SESSION);
            //create an output stream to the output blob
              OutputStream os = outPDF.setBinaryStream(0);               
            //instantiate the pdf merger utility
              PDFMergerUtility mergerUtility = new PDFMergerUtility();       
            //connect the merger to the output stream
              mergerUtility.setDestinationStream(os);
            //stream from each input blob into the merger utility
              mergerUtility.addSource(pdfdoc1.getBinaryStream());
              mergerUtility.addSource(pdfdoc2.getBinaryStream());
            //merge the 2 input pdfs
              mergerUtility.mergeDocuments();             
            //do not close the output stream
            //return the blob
            return outPDF;
        }
    
    }
    

    CREATE OR REPLACE package PDFTOOLS.pkg_pdf_utilities
    as
    function f_get_merged_pdf (
              pi_pdf1       blob
            , pi_pdf2    blob
      )
      return blob;
    end pkg_pdf_utilities;
    /
    
    CREATE OR REPLACE package body PDFTOOLS.pkg_pdf_utilities
    as
    function f_get_merged_pdf (
              pi_pdf1       blob
            , pi_pdf2    blob
      )
      return blob
      as language java name 
      'com.mycode.pdftools.PDFUtilities.appendPDF(oracle.sql.BLOB, oracle.sql.BLOB) return oracle.sql.BLOB';
    end PDFTOOLS.pkg_pdf_utilities;
    /
    

    It's very basic, but doesn't seem to work. However, I want to my function from PL/SQL to a procedure that looks like this:

    CREATE OR REPLACE package PDFTOOLS.pkg_pdf_utilities
    as
    procedure sp_append_pdf (
              pio_pdf2append2   IN OUT NOCOPY blob
            , pio_pdf2append   IN OUT NOCOPY blob
      )
    end pkg_pdf_utilities;
    /
    

    What is important, what I'm trying to do is to NOCOPY the BLOBs. Otherwise, I have to read my PDF files into 2 BLOBs and create a 3rd blob as output. I prefer to be able to keep the pio_pdf2append2 as the final output. What I actually do call thing in a loop to gradually add a PDF file to a big. I'm not linking this in one operation because of concerns over the use of the system and because the pdfbox library java has would have been question after 850 in PDF format, which is not completely unrealistic in my approach.

    How could I achieve this?

    Post edited by: Pollocks01 only formatted code blocks because atlassian {code} tags didn't work.

    Passage of an argument as input/OUTPUT requires the mapping to a Java array.

    Simplified example that adds one FOR the other:

    create or replace and compile java source named blob_appender_src as
    import oracle.sql.BLOB;
    import java.sql.SQLException;
    import java.io.OutputStream;
    import java.io.InputStream;
    import java.io.IOException;
    
    public class BLOBAppender {
        public static void run (BLOB[] p1, BLOB p2) throws SQLException, IOException { 
    
            InputStream is = p2.getBinaryStream();
            OutputStream os = p1[0].setBinaryStream(p1[0].length()+1);                
    
            byte[] buffer = new byte[1024];
            int len;
            while ((len = is.read(buffer)) != -1) {
                os.write(buffer, 0, len);
            }
            os.close();
            is.close();
        }
    }
    
    create or replace procedure blob_append (
      p_lob1  in out nocopy blob
    , p_lob2  in            blob
    )
    as language java name 'BLOBAppender.run(oracle.sql.BLOB[], oracle.sql.BLOB)' ;
    /
    
    SQL> declare
      2    p_lob1  blob := utl_raw.cast_to_raw('ABC');
      3    p_lob2  blob := utl_raw.cast_to_raw('DEF');
      4  begin
      5    blob_append(p_lob1, p_lob2);
      6    dbms_output.put_line(utl_raw.cast_to_varchar2(p_lob1));
      7  end;
      8  /
    
    ABCDEF
    
    PL/SQL procedure successfully completed.
    
  • How to convert Oracle DB SQL?

    Hello everyone, nice to meet you!

    First of all I apologize for:

    -my pretty terrible English

    -the fact that I am a complete novice in databases and that my question may sound like proof full for most of you

    -the fact that there are probably a billion discussions on this subject, but after many hours lost in the research in this forum or elsewhere, I just dropped...

    So now that these points are mentioned, here's my problem with my own green words:

    Goal: Be able to log in and then convert it using SSMA SQL restore an Oracle DB from a dump file (.dmp).

    My first step was to be able to install Oracle Databese Express 11 GR 2.

    Then, I installed MASA and launch it to reach my goal.

    To connect to Oracle, I now have to choose a mode of connection, including one of these two ( https://msdn.microsoft.com/en-us/library/hh313203(v=sql.110).aspx text):

    1. If you select the Standard mode, provide the following values:
      1. In the server name box, type or select the name or the IP address of the database server.
      2. If the database server is not configured to accept connections on the default port (1521), type the port number that is used for connections in the Oracle Server port box.
      3. In the Oracle SID , enter the system identifier.
      4. In the user name box, enter an Oracle account that has the necessary permissions.
      5. In the password box, enter the password for the specified username.
    2. If you select the TNSNAME mode, provide the following values:
      1. Of the login , enter connect (aka TNS) of the database identifier.
      2. In the user name box, enter an Oracle account that has the necessary permissions.
      3. In the password box, enter the password for the specified username.

    .. .but I don't know even how to find the SID of the Oracle... I tried with the name of the server: localhost, Oracle SID: XE and SYSTEM and password, but it didn't work.

    So I tried with the TNSNAME, identifier of connection mode: XE (found on my default tnsnames.ora file), SYSTEM/password and it still does not work.

    It would be really nice of you to reflect on this and share your ideas on how to get through this stage of the process and the weather, you have an idea to do the rest (BD restoration/conversion) too!

    Thank you very much.

    VMAT wrote:

    EdStevens wrote:

    [...] or if the database IS local, an ORACLE_SID incorrectly specified.  [...]

    This is my point of view. I don't know what means the "ORACLE_SID". "XE"? Something else? I don't know where to find it!

    Everything we've seen up to this says that your ORACLE_SID is XE.

    BTW, ORACLE_SID is the name of an environment variable.  The value associated with this variable should be "XE".

    As I said, I'm stuck at level zero here.

    I certainly miss to run a crucial step for, I don't know, to create a standard database where I could connect or something I don't know, but the fact is that I can not even use impdp on my .dmp file because I can't seem to log on before...

    Everything that I did is to install Oracle DB Express and MASA in practice. I missed something to do after that?

    If your installation of Oracle DB Express went well, you should have a database named XE and you should be able to connect to it.

  • JDK. DIO with Java SE instead of Java ME

    Sorry for posting in the Java ME Community. It's really a question SE with libraries of jdk.dio me.

    After my problems not solved with opening/dev/servoblaster pipe of Java ME (see my other post), I went to Java SE and added jdk.dio, netbeans libraries both on IP to raspberries.

    Opening servoblaster works very well but now a new problem:

    I am trying the same code that worked perfectly in Java ME to open a GPIO PIN for entries, as shown below. Doing this in Java SE with jdk.dio causes a nullpointerexception on the last statement when I try to check if the PIN is open. I get the same error when I try to set a value for the axis. No error message on the declaration of DeviceManager.open.

    Because it works without problem in the Java ME environment, that I suspect is has something to do with the installation of the remote device and the related authorizations.

    I SE the remote device configuration is different and I think I don't see approval in the same way as for a Java ME embeddeddevice. In netbeans, I defined the Pi as a platform for remote execution and during the generation, it connects and compile without problem.

    Permissions, I put on the invoice, pro forma. Since I found the safety instructions fairly clear, I added GPIOPin GPIOPort and DeviceMgmt permissions to several folders (better safe than sorry :-))

    /dev/test/Java.policy

    usr/lib/JVM/JDK-8-Oracle-ARM-VFP-hflt/jre/lib/security/java. Policy

    / HOMR/pi/NetBeansProjects/MyProjectName/dist/GPIO. Policy

    but it does make a difference.

    I've also set the pins GPIO B + extra in /dev/config/dio.properties-raspberrypi

    No idea why it does not work? All advice appreciated.

    Kind regards

    Willem

    code used:

    GPIOPinConfig config2 = new GPIOPinConfig (portID, 12, GPIOPinConfig.DIR_INPUT_ONLY, DeviceConfig.DEFAULT, GPIOPinConfig.TRIGGER_BOTH_EDGES, false);

    try {}
    HCSR04Receive = DeviceManager.open (config2);
    } catch (IOException ex) {}
    Logger.getLogger (hcsr04me.class.getName ()) .log (Level.SEVERE, null, ex);
    }

    System.out.println (HCSR04Receive.IsOpen ());

    Thank you

    I solved it myself a minute ago.

    I found this article: https://www.voxxed.com/blog/2014/12/device-io-api/ and then followed step by step, applying to my project.

    He ran my project without problem and between listing 3 and 4, he copy a number of files with the command cp - r/build/deviceio/lib / * home/pi / $ JAVA_HOME/jre/lib (although you need to run it as sudo and it only says not in the instructions).

    After that she also connected my NetBeans project, so I guess that these missing files caused problems.

    So now I'm going to continue my project using:

    • Java SE in order to open/dev/servoblaster, which is not possible in Java ME
    • using PI4J with WiringPi libraries for implementing good implementation of the software PWM
    • using the jdk.dio for any other control gpio libraries

    Thank you

    Willem

Maybe you are looking for

  • compare data on excel

    I'm using labview 7.1 and I have problems to compare data on two spreadsheet with about 30 + data and also have problems of data backup on the same excel worksheet. Like after comparing, I want to add value to the next column to _result.xls. This is

  • How to print photos taken with the Iphone?

    I sent photos by e-mail to my pc (not a Mac) and keep told to load onenote.  I used to be able to print from pc?  Comments to onenote are not real positive and I prefer not to use it if there is another way

  • connection request password after windows xp update

    HelloI've recently updated my xp sp2 with automatic updates after install the updates im unable to login my account it asks for the password, in the only administrator of my pc im and no password is set on. Could you pl.guide me how to get rid of thi

  • CodeModuleGroup and JAD - is my way of pushing through my application properties an OTA Download?

    Hi guys,. I've been searching on this during a while but do not get the answers I need.  Looking for confirmation.  I am trying to get my head around how I'll roll my own app OTA distribution.  Initially just if I have a way to do tests in-house OTA

  • What is an I / Q error? This occurs with the backups using external hard drive SeaGate

    We have two external hard drives; a 3Terabyte (don't know how it) Seagate and another whose name escapes me. On the Seagate, I get the message: backup did not complete due to I / Q error. What is I / Q error and how to fix this? If all goes well, not