Oracle PL/SQL to Java Migration

Delivering you an intelligent and high quality result in due time!

Automated Application Conversion

Do you need to convert your Oracle PL/SQL application to Java? In this case, Ispirer products will be the perfect solution for your project!
Human-written code in each project has its own specifics. It may seem difficult to obtain a high level of automated conversion. With Ispirer it will be a smooth transition. The main advantage of Ispirer Toolkit is the personalization for your conversion project. As a result, you will replace the old technology with all its downsides. The outcome will be a new application without any middleware used afterwards.

How it Works

Ispirer Toolkit

Automated conversion of Oracle PL/SQL to Java with the help of our tool makes it possible to significantly reduce the time and expenses as compared to manual rewriting of the application. The following approach allows to ensure high quality of automated conversion:

1. Preliminary Stage

The stage is carried out to determine the current conversion level of Ispirer Toolkit. The level of conversion depends on the complexity of the source code and the requirements for the target application. You can independently perform the analysis of the source code of your Oracle PL/SQL application, as well as try to convert it to Java using the demo license. Besides, our experts can perform the source code analysis and provide you with examples of its conversion.
If your application is quite specific and large, we recommend to perform PoC to determine the maximum level of automated conversion of your project.
As a result, we will find out whether the customization is required or you can directly proceed to the conversion.

2. Ispirer Toolkit Customization Stage

If this stage is necessary, we will perform the customization to thoroughly prepare the toolkit for the conversion according to your project requirements. We will take a part of a representative code that amounts ussually to ~100,000 lines. The Ispirer technical team will add all the required conversion rules into the tool to achieve the highest possible level of automation or even to get a compilable result. As a delivery, we will provide conversion results of the scope of this customization. The customer will get a tailored and updated tool according to his specific project needs.

3. Use of Ispirer Toolkit

At this stage, you perform the conversion yourself. As to pricing, we apply project-based licensing. Prices depend on its scope and duration. The license includes support as well. If necessary, the conversion may be further improved even at this stage. As a result, customization requests, each of which is processed within 1-3 business days, are added to the license. Our experts will recommend the optimal number of requests considering the complexity and requirements of your project.

Ispirer Toolkit 10 Icon

Ispirer Toolkit 10
Oracle PL/SQL to Java
Free Demo License

Try Now

Ispirer Migration and Modernization Service (Ispirer Service)

Our experienced team can provide you with a turnkey migration service and convert your entire Oracle PL/SQL application to Java, delivering you a ready-to-use application in due time. Our responsibilities include not only professional analysis, assessment, performance and testing of your migration, but also services such as adding new or changing existing functionality of the application.

If you want to get an intermediate result of the converted Oracle PL/SQL code in the Java language, the Ispirer team will be glad to provide you with a basic migration service. As a result, you will get code that is optimized to the compilable level. Further, you will have to independently bring the application to a fully functional state in accordance with your requirements.

You are free to choose a preferred option. Nevertheless, we can provide an estimate of both the Tool and the Service, and give professional advice.

Conversion Overview

SQL Migration

Ispirer Toolkit automatically converts Oracle PL/SQL to Java, considering the specifics of these languages. Both conversion with connection to the source database, as well as conversion of files containing PL/SQL scripts are possible. Our tool supports conversion of the following objects: packages (specification and body), collection and object types, functions, procedures. At the same time, tables, views, triggers and sequences remain on the side of Oracle. As a result of conversion, each separate database object is converted to a Java class. Class names are formed based on object names, taking into account the Java Naming Convention.
In case, you need your Java application to work with a different database, Ispirer Toolkit can convert Embedded SQL and the database itself.

Variable Conversion
Ispirer Toolkit automatically converts function and procedure variables (nested or not) to method variables, as well as package variables to class variables. The tool supports conversion of all Oracle data types. Moreover, when converting variables, their visibility is taken into account.

Code Conversion
Procedures and functions are converted to classes with one method. Packages are converted to classes, their nested functions and procedures into methods of this class, taking into account their visibility. Initialization block is converted to the class constructor. Oracle built-in functions and procedures are converted either to the same Java methods, if any, or to the methods of our Plsqlutils helper class.

Working with Database
Oracle SQL Statements can be converted to JDBC, Hibernate, Spring JDBCTemplate. In addition, we have implemented the ability to export SQL statements to XML files for their support optimization. Besides, the logic of working with cursors is transferred to Java.

Working with Collections
Ispirer Toolkit supports collection conversion of all three types: Associative array, Nested table, Variable-size array (varray). For optimal collection conversion, we have developed helper classes that allow to repeat the logic of Oracle collections in Java.

Oracle Supplied PL/SQL Package Conversion
Ispirer Toolkit supports conversion of some Supplied PL/SQL Packages, such as UTL_FILE, DBMS_LOB and others. The list can be expanded based on the requirements of your conversion project.

Oracle PL/SQL to Java Conversion Demo

Check out how Ispirer Toolkit automatically converts Transact-SQL application.


Drop us a line, if you have any business inquiries or questions regarding your Oracle PL/SQL conversion project. Ispirer experts will demonstrate our solutions and answer any questions you may have!

Contact us

Conversion Samples of Oracle PL/SQL to Java

Ispirer Toolkit analyzes all object dependencies during the conversion process and provides not only line-by-line conversion, but resolves type conversions as well. In addition, the software understands and transforms the necessary inheritance dependencies. It parses the entire source code, builds an internal tree with all the information about the objects, and uses it in the migration process. For more information review the code samples below.

Common variables declaration structure conversion:

Oracle PL/SQLJava
  1.  
  2. CREATE OR REPLACE PACKAGE pkgWithVars
  3. NORMAL CONSTANT NUMBER := 0;
  4. FOUND CONSTANT NUMBER := 1;
  5. INST VARCHAR2(50) := 'pkgWithVars';
  6. /
  7. CREATE PACKAGE BODY pkgWithVars AS
  8.  
  9. My_Status NUMBER(5);
  10. My_Status := Normal;
  11. END;
  12.  
  13.  
  1.  
  2. package com.ora;
  3. import java.math.*;
  4. public class Pkgwithvars {
  5.  
  6. private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger(Pkgwithvars.class);
  7. public static final BigDecimal NORMAL = new BigDecimal("0");
  8. public static final BigDecimal FOUND = new BigDecimal("1");
  9. private String inst = "pkgWithVars";
  10. public String getInst() {
  11. return inst;
  12. }
  13. public void setInst(String inst) {
  14. this.inst = inst;
  15. }
  16. public void sp() throws Exception {
  17. try {
  18. Integer myStatus = null;
  19. myStatus = NORMAL.setScale(0, RoundingMode.HALF_UP).intValueExact();
  20. }
  21. catch (Exception e) {
  22. LOGGER.error(String.valueOf(e));
  23. throw e;
  24. }
  25. }
  26. }
  27.  

%ROWTYPE attribute and Record Type conversion:

Oracle PL/SQLJava
  1.  
  2.  
  3. rec1 PREC_TAB%ROWTYPE;
  4.  
  5. TYPE rec2_tp IS RECORD (
  6. inst_id NUMBER,
  7. instr_dt DATE
  8. );
  9.  
  10. rec2 rec2_tp;
  11. v1 NUMBER := 5;
  12.  
  13.  
  14. rec1.PREC_ID := v1;
  15. v1 := rec2.inst_id;
  16.  
  17.  
  1.  
  2. public class PrecTab {
  3. private BigDecimal precId;
  4. private String precSt;
  5. private Integer cnt;
  6. public BigDecimal getPrecid() {
  7. return precId;
  8. }
  9. public void setPrecid(BigDecimal precId) {
  10. this.precId = precId;
  11. }
  12. public String getPrecst() {
  13. return precSt;
  14. }
  15. public void setPrecst(String precSt) {
  16. this.precSt = precSt;
  17. }
  18. public Integer getCnt() {
  19. return cnt;
  20. }
  21. public void setCnt(Integer cnt) {
  22. this.cnt = cnt;
  23. }
  24.  
  25. public PrecTab() {
  26. }
  27.  
  28. public PrecTab(BigDecimal precId, String precSt, Integer cnt) {
  29. this.precId = precId;
  30. this.precSt = precSt;
  31. this.cnt = cnt;
  32. }
  33.  
  34. public PrecTab(PrecTab prectab) {
  35. this.precId = prectab.precId;
  36. this.precSt = prectab.precSt;
  37. this.cnt = prectab.cnt;
  38. }
  39. }
  40.  
  41.  
  42. public class Example {
  43.  
  44. private static final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger(Example.class);
  45. private static class Rec2Tp {
  46.  
  47. private BigDecimal instId;
  48. private Timestamp instrDt;
  49. public BigDecimal getInstId() {
  50. return instId;
  51. }
  52. public void setInstId(BigDecimal instId) {
  53. this.instId = instId;
  54. }
  55. public Timestamp getInstrDt() {
  56. return instrDt;
  57. }
  58. public void setInstrDt(Timestamp instrDt) {
  59. this.instrDt = instrDt;
  60. }
  61. public Rec2Tp() {
  62. }
  63. public Rec2Tp(BigDecimal instId, Timestamp instrDt) {
  64. this.instId = instId;
  65. this.instrDt = instrDt;
  66. }
  67. public Rec2Tp(Rec2Tp rec2Tp) {
  68. if (rec2Tp != null) {
  69. this.instId = rec2Tp.instId;
  70. this.instrDt = rec2Tp.instrDt;
  71. }
  72. else {
  73. this.instId = null;
  74. this.instrDt = null;
  75. }
  76. }
  77. }
  78. public void spQuickfileSql() throws Exception {
  79. try {
  80. PrecTab rec1 = new PrecTab();
  81. Rec2Tp rec2 = new Rec2Tp();
  82. BigDecimal v1 = new BigDecimal("5");
  83. rec1.setPrecId(v1);
  84. v1 = rec2.getInstId();
  85. }
  86. catch (Exception e) {
  87. LOGGER.error(String.valueOf(e));
  88. throw e;
  89. }
  90. }
  91. }
  92.  

For collection types conversion we’ve implemented additional classes that have same behavior as Oracle collections:

Oracle PL/SQLJava
  1.  
  2.  
  3. TYPE student_arraytype IS TABLE OF student%ROWTYPE INDEX BY PLS_INTEGER;
  4. student_array student_arraytype;
  5.  
  6.  
  7. FOR i IN student_array.FIRST .. student_array.LAST
  8. DBMS_OUTPUT.PUT_LINE(student_array(i).FIRST_NAME);
  9.  
  10.  
  1.  
  2. AssociativeCollection < Integer, Student > studentArray = new AssociativeCollection < >( Integer.class, new Student());
  3.  
  4. for (int i = studentArray.first(); i <= studentArray.last(); i ++) {
  5. System.out.println(studentArray.get(i).firstName);
  6. }
  7.  

Cursor conversion (JDBC):

Oracle PL/SQLJava
  1.  
  2.  
  3. CURSOR C_STUD IS
  4. SELECT * FROM STUDENT;
  5.  
  6. FOR STUD_REC IN C_STUD
  7.  
  8. STUD_UPDATE(STUD_REC);
  9.  
  10.  
  1.  
  2. Student studRec = new Student();
  3.  
  4. try(PreparedStatement stResCStud = mConn.prepareStatement("SELECT * FROM STUDENT"); ResultSet rsResCStud = stResCStud.executeQuery();) {
  5. while (rsResCStud.next()) {
  6. studRec.setStudentid(rsResCStud.getString(1));
  7. studRec.setLast(rsResCStud.getString(2));
  8. studRec.setFirst(rsResCStud.getString(3));
  9. studRec.setBirthdate(rsResCStud.getTimestamp(4));
  10. studRec.setFacultyid(rsResCStud.getInt(5));
  11. studUpdate(studRec);
  12. }
  13. }
  14.  

Cursor conversion (Spring JDBC):

Oracle PL/SQLJava
  1.  
  2.  
  3. CURSOR C_STUD IS
  4. SELECT * FROM STUDENT;
  5.  
  6. FOR STUD_REC IN C_STUD
  7.  
  8. STUD_UPDATE(STUD_REC);
  9.  
  10.  
  1.  
  2. SqlRowSet rsCStud = null;
  3. Boolean fsCStud = null;
  4.  
  5. try {
  6. Student studRec = new Student();
  7. rsCStud = jdbcTemplate.queryForRowSet("SELECT * FROM STUDENT");
  8.  
  9. do {
  10. fsCStud = rsCStud.next();
  11.  
  12. if (Boolean.FALSE.equals(fsCStud)) {
  13. break;
  14. }
  15.  
  16. studRec.setStudentid(rsCStud.getString(1));
  17. studRec.setLast(rsCStud.getString(2));
  18. studRec.setFirst(rsCStud.getString(3));
  19. studRec.setBirthdate(rsCStud.getTimestamp(4));
  20. studRec.setFacultyid(rsCStud.getInt(5));
  21. studUpdate(studRec);
  22. }
  23. while (Boolean.TRUE.equals(fsCStud));
  24. }
  25. catch (Exception e) {
  26. LOGGER.error(String.valueOf(e));
  27. throw e;
  28. }
  29.  

Cursor conversion (Hibernate):

Oracle PL/SQLJava
  1.  
  2.  
  3. CURSOR C_STUD IS
  4. SELECT * FROM STUDENT;
  5.  
  6. FOR STUD_REC IN C_STUD
  7.  
  8. STUD_UPDATE(STUD_REC);
  9.  
  10.  
  1.  
  2. Boolean fsCStud;
  3. List<Object[]> cStudList = null;
  4. Iterator<Object[]> itrCStud;
  5.  
  6. try {
  7. Student studRec = new Student();
  8.  
  9. cStudList = session.createNativeQuery("SELECT * FROM STUDENT").list();
  10.  
  11. do {
  12. itrCStud = cStudList.iterator();
  13. fsCStud = itrCStud.hasNext();
  14.  
  15. if (!fsCStud) {
  16. break;
  17. }
  18.  
  19. Object[] objCStud = itrCStud.next();
  20. studRec.setStudentid(QueryUtility.toObject(objCStud[0], String.class));
  21. studRec.setLast(QueryUtility.toObject(objCStud[1], String.class));
  22. studRec.setFirst(QueryUtility.toObject(objCStud[2], String.class));
  23. studRec.setBirthdate(QueryUtility.toObject(objCStud[3], String.class));
  24. studRec.setFacultyid(QueryUtility.toObject(objCStud[4], String.class));
  25. StudUpdate.spStud_update(studRec);
  26. }
  27. while (fsCStud);
  28.  
  29. cStudList = null;
  30. }
  31. catch (Exception e) {
  32. LOGGER.error(String.valueOf(e));
  33. throw e;
  34. }
  35.  

Output parameters conversion:

Oracle PL/SQLJava
  1.  
  2. CREATE PACKAGE BODY sample_pkg
  3. PROCEDURE open_cursor (
  4. PAR_ID IN OUT VARCHAR2,
  5. PAR_SAJES_OUT OUT sys_refcursor
  6. )
  7. IS
  8.  
  9. OPEN PAR_SAJES_OUT FOR
  10. SELECT DAD_ID FROM SDAD;
  11.  
  12. END;
  13.  
  14. PROCEDURE main_sp
  15. IS
  16. V_ID VARCHAR2(50);
  17. V_SAJES open_cursor;
  18.  
  19. proc_test(V_ID, V_SAJES);
  20.  
  21. END;
  22.  
  1.  
  2. public Map<String, Object> openCursor(String parId)
  3. throws Exception {
  4. RowSetFactory rowSetFactory = RowSetProvider.newFactory();
  5. Map<String, Object> outData = new HashMap<>();
  6. CachedRowSet parSajesOut = rowSetFactory.createCachedRowSet();
  7. Connection mConn = JDBCDataSource.getConnection();
  8.  
  9. try {
  10. try(PreparedStatement mStmt = mConn.prepareStatement("SELECT DAD_ID FROM SDAD");) {
  11. try(ResultSet rs = mStmt.executeQuery();) {
  12. parSajesOut.release();
  13. parSajesOut.populate(rs);
  14. }
  15. }
  16. catch (SQLException se) {
  17. SQLCursorHandler.getInstance().handleExeption(se);
  18. throw se;
  19. }
  20.  
  21. if (!mConn.getAutoCommit()) {
  22. mConn.commit();
  23. }
  24.  
  25. return outData;
  26. }
  27. catch (Exception e) {
  28. LOGGER.error(String.valueOf(e));
  29. throw e;
  30. }
  31. finally {
  32. outData.put("par_id", parId);
  33. outData.put("par_sajes_out", parSajesOut);
  34.  
  35. if (mConn != null) {
  36. mConn.close();
  37. }
  38. }
  39. }
  40.  
  41. public void mainSp() throws Exception {
  42. try {
  43. String vId = null;
  44. OpenCursor vSajes = new OpenCursor();
  45. ProcTest.spProc_test(vId, vSajes);
  46. }
  47. catch (Exception e) {
  48. LOGGER.error(String.valueOf(e));
  49. throw e;
  50. }
  51. }
  52.  

Nested procedure conversion:

Oracle PL/SQLJava
  1.  
  2. CREATE PROCEDURE pkg_nested_example IS
  3. PROCEDURE CHECK1 IS
  4.  
  5. W_TOBE CHAR(1) := '0';
  6. W_PAR CHAR(1) := '0';
  7.  
  8. W_PAR := '1';
  9. W_TOBE := '1';
  10. END;
  11.  
  12. CHK;
  13. END;
  14.  
  15. CHECK1;
  16.  
  1.  
  2. public void spPkgNestedExample() throws Exception {
  3. class NestedFunctions {
  4.  
  5. public void check1(MutableObject<String> mutablewTobe, MutableObject<String> mutablewPar) throws Exception {
  6. String wTobe = mutablewTobe.getValue();
  7. String wPar = mutablewPar.getValue();
  8.  
  9. try {
  10. wPar = "1";
  11. wTobe = "1";
  12. }
  13. catch (Exception e) {
  14. LOGGER.error(String.valueOf(e));
  15. throw e;
  16. }
  17. finally {
  18. mutablewTobe.setValue(wTobe);
  19. mutablewPar.setValue(wPar);
  20. }
  21. }
  22. }
  23.  
  24. try {
  25. String wTobe = "0";
  26. String wPar = "0";
  27. NestedFunctions nestedFunctions = new NestedFunctions();
  28. MutableObject<String> mutablewTobe = new MutableObject<>();
  29. MutableObject<String> mutablewPar = new MutableObject<>();
  30. mutablewTobe.setValue(wTobe);
  31. mutablewPar.setValue(wPar);
  32. nestedFunctions.check1(mutablewTobe, mutablewPar);
  33. wTobe = mutablewTobe.getValue();
  34. wPar = mutablewPar.getValue();
  35. }
  36. catch (Exception e) {
  37. LOGGER.error(String.valueOf(e));
  38. throw e;
  39. }
  40. }
  41.  

Download Sample Code

You have just examined only a piece of the Oracle PL/SQL to Java conversion sample. You can download the entire application migration sample for free by filling out the form. Once you get the code sample, you will be able to:

  • Explore how well Ispirer Toolkit migrates the source code to the target technology without downloading it.
  • Analyze and compare the source sample with your code to understand which components of your application can be automatically converted using Ispirer Toolkit.
  • Run, play with and test an application containing nearly 600 lines of code.

See for yourself that Ispirer Toolkit can automatically convert not only a single piece of code, but an entire application. Most likely, complex code will require customization of the toolkit, but our experts can add new conversion rules within 3-5 business days. As a result, using Ispirer Toolkit you will get readable and maintainable code of manual conversion quality in the shortest time possible.

Snatch a totally free opportunity to see the high efficiency of Ispirer Toolkit!

Get your sample code
Enter your name.

Enter a valid e-mail address.

Select your country.

Invalid input.

Get a Quote

Ispirer Toolkit

Reach the maximum level of automation and quality of your conversion with the help of Ispirer Toolkit! Based on your requirements, the Ispirer team will process all customization requests for your Oracle PL/SQL to Java conversion project. We offer several types of Ispirer Toolkit licenses, among which you will find the one that is suitable for you. Each conversion project is considered and discussed separately, prices depend on its scope, duration and complexity.

Ispirer Toolkit 10 Icon

Ispirer Toolkit 10
Oracle PL/SQL to Java

Request a Quote

Ispirer Service

If you don't want to involve your own resources to move the Oracle PL/SQL application to Java, get Ispirer Migration and Modernization Service and we will deliver you an operational and high-quality end-result on time and at a reasonable price. Apart from professional Analysis, Evaluation, Performance and Testing of your migration, we also provide such services as Code Refactoring, Changing Functionality, and Adding Extra Functionality. Each conversion project is reviewed and discussed separately and the final price is a subject to negotiation.

Ispirer Migration Service

Ispirer Migration Service
Oracle PL/SQL to Java

Get an Estimate

Benefits You Get

100% Automation

100% Automation

Due to the customization, the manual work after migration will be minimized or eliminated.

Flexible Pricing

Flexible Pricing

You pay for only what you need: prices depend on the scope and duration of your project.

Optimized Migration

Optimized Migration

You get an intelligent and maintainable code without using any middleware after conversion.

What Our Customers Say

"Beckman Coulter provided as much of the information as we could but there was a lot of functionality that we did not know. This is where Ispirer talents became apparent as they forensically reengineered functionality."

"We are now successfully running live on the new system, with the updated PB apps. I want to express my thanks to Ispirer team. You made this project a success!!! I was happy to work with you and would highly recommend Ispirer!"

"Because of Ispirer and MnMTK, our team was able to devote its time to build the infrastructure for new Java programs instead of spending time on converting code. The produced Java code met all our maintainability, readability and performance requirements."

"This approach was very successful avoiding any confusion at the first stage, and achieved high conversion rate in the end. The project was completed successfully, they say they couldn't make it without MnMTK 2017 and excellent extension support from lspirer."

"At the onset of the engagement the Ispirer MnMTK was expanded to meet the specific requirements of our migration prior to being delivered for our use. Once this phase of the project was complete we were provided with the expanded toolkit."

"We have found the Ispirer team to be knowledgeable and responsive and we have found the tooling to be flexible enough to be easily adapted to our coding conventions."

previous arrow
next arrow
Slider

Get in touch with us!

Have questions about migration from Oracle PL/SQL to Java?

Contact us