Oracle PL/SQL to Java Migration

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

Benefit from the Ispirer top-notch migration services and robust automated solutions. Foster migration, and optimize the cost and performance of your IT infrastructure by converting your Oracle PL/SQL application to Java with Ispirer.

Migrate Oracle PL/SQL to Java

Chip

Ispirer Toolkit for automated conversion

Ispirer Toolkit offers a range of opportunities for automated Oracle PL/SQL to Java conversion with minimum manual corrections:

  • Free Assessment Wizard for analyzing your database and estimating migration complexity
  • Assistance in nGLFly and SQLWays configuration
  • Automated migration of SQL objects, such as stored procedures, to Java
  • Prompt customization of the toolkit to maximize automation rate
  • Expert support during the entire project

Check all the features by requesting a free trial of Ispirer Tookit.
It is valid for 30 days.

Free trial

People

Turnkey migration service

Turnkey Oracle PL/SQL to Java migration service provided by Ispirer professionals includes:

  • Migration of SQL objects, such as stored procedures, to Java
  • Team of experts skilled in Oracle PL/SQL and Java
  • Tailored migration roadmap from assessment through migration and testing to cutover
  • Smart automation with Ispirer Toolkit
  • Assistance in deployment, integration, performance optimization, and new feature development


Drop us a line and we’ll discuss and estimate your Oracle PL/SQL to Java project.

Request a quote

Ispirer Toolkit opportunities

  • Migration with\without connection to databases. Ispirer Toolkit can work with or without a database connection. Both options allow you to successfully migrate business logic from the database to the application level. However, it is worth considering that connecting to the database allows Ispirer Toolkit to take into account additional information from the database and helps improve conversion.
  • Database API access. Ispirer Toolkit enables users to choose the database API for accessing the database in the target application. Depending on the project's requirements, you can select the most suitable option from the supported APIs: Hibernate, JDBC, LINQ, or ADO.NET.
  • Migration of Embedded SQL. Ispirer Toolkit offers the opportunity to streamline the migration process of Embedded SQL, reducing manual effort and potential errors. By leveraging this tool, businesses can efficiently transition their Embedded SQL codebase to a new platform.

Ispirer Toolkit

  • Customization. Ispirer Toolkit is an expert system that enables you to control migration while achieving excellent conversion quality through customization. In essence, customization is the process of incorporating new conversion rules to the core of Ispirer Toolkit. The Ispirer team can customize our product in order to improve the migration quality to the maximum.

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 Oracle PL/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


Turnkey Migration Service

The entire conversion process can be divided into several stages:

  • Preparation. During the preparation stage, the focus lies on planning and preparing applications and infrastructure for migration to a new environment or platform. This involves assessing their current state to gauge compatibility with the target environment and defining the migration strategy, timeline, and required resources. Additionally, identifying potential risks and challenges associated with the migration process and devising mitigation strategies are integral parts of this stage.
  • Assessment. During the assessment phase, the team conducts a thorough analysis of the source code to accurately estimate the migration timeframe and cost. As a first step, we apply Assessment Wizard - a tool tailored for analyzing the source database before migration. This product gathers information about objects, their internal structures, and statements automatically. This tool produces a comprehensive report with the analyzed data allowing for the estimation of migration costs and timelines.

APP Services general

  • Automated conversion with Ispirer Toolkit. Considering the inherent characteristics of the original technology, Ispirer Toolkit can provide varying default levels of automated code conversion. Importantly, Ispirer experts can iteratively customize the tools to meet the specific properties and patterns of the source code and thus increase the level of automated conversion.
  • Post-conversion refinement. Often an application may contain code segments that are impossible or ineffective to migrate automatically. In such a case, our team of Ispirer experts leverages their extensive knowledge and expertise to meticulously execute the manual migration of the remaining code. Moreover, this stage involves fine-tuning the application to improve its performance in the new environment. This may include optimizing resource allocation, tuning database configurations, and addressing any performance bottlenecks.
  • Functional testing. Functional testing ensures that the migrated application behaves as expected and meets the functional requirements in the new environment. The Ispirer experts run hundreds of tests to ensure that the converted application is reliable and meets user requirements, business objectives, and industry standards.

Looking for Oracle PL/SQL to Java Conversion Services?

Drop us a line and we’ll estimate your project for free!

Request a quote

Why migrate business logic from database to application

Customized migration plan

Enhanced agility

Applications can offer more flexibility and agility in managing and modifying business logic compared to databases. It's easier and faster to update and iterate on application code rather than altering database structures and stored procedures.

Enhanced efficiency

Portability

Business logic embedded within applications is typically more portable across different database systems or platforms. This can be beneficial if the business needs to switch database vendors or deploy the application in various environments.

Advanced security

Improved performance

Application servers are much easier to scale than database servers. For example, an application can be placed in a container and used as needed, depending on the load created by users. As a result, it will be much easier and cheaper to achieve the performance you need from the system.

Cost reduction

Cost savings

Customers that already migrated their business logic to application benefit from reducing costs of maintainability. Besides, business logic in the application allows developers to focus on high-value tasks, fostering innovation and creativity.

Reduced data redundancy

Accelerated time-to-market

Expedite the deployment of new features and functionalities by moving domain logic to an application layer and enable faster innovation cycles.

Reduced data redundancy

RDBMS dependency eliminated

Having business logic in the application layer unties your hands if you are planning to change a database management system in the future. Besides, such an approach makes it possible to support several databases simultaneously.


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.

Our Projects

Why Migrate with Ispirer

With a proven track record validated by both time and satisfied clients, Ispirer software and services stand as the pinnacle choice for database migration and application modernization. Leveraging years of experience and client feedback, Ispirer guarantees smooth transitions and optimized operational efficiency for businesses of all scales.

  • Seasoned team. Ensuring high security and performance standards is what we do best, thanks to our impressive experience in building reliable and scalable solutions.
  • Technology expertise. Having 20+ years of experience our team has gained a wide pool of expertise in various programming languages from the rarest to the most popular ones.
  • Top-notch data security. We comply with ISO 27001 security management requirements with comprehensive policies and processes, advanced security technology, and skilled professionals.
  • Proprietary tools. In migration projects we employ Ispirer proprietary tools which underscores our dedication to delivering solutions of utmost reliability and performance. Compiled on a daily basis, this toolkit continually integrates dozens of new conversion rules, thereby consistently enhancing the automation capabilities. Find out more about our solution in the infographic:
Infographics showing how automatic application and database migration brings benefits

What Our Customers Say

Get in touch with us!

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

Contact us