Intelligent, Custom and Highly Automated Cross Platform Database and Application Migration


Delphi to Java EE Migration


Ispirer MnMTK converts Delphi applications to Java EE with Spring MVC Framework.

This demo is showing how Ispirer MnMTK can convert Delphi to Java EE.



Conversion Features

Migrate Delphi to Java

  • Converts Delphi source code with business logic (*.pas) to Java classes

Delphi:

  1.  
  2. unit Unit4;
  3.  
  4. interface
  5.  
  6. uses
  7. Windows, Messages, SysUtils, Variants, Classes,
  8. Graphics, Controls, Forms, Dialogs, StdCtrls;
  9.  
  10. type
  11. TForm4 = class(TForm)
  12. Button1: TButton;
  13. Edit1: TEdit;
  14. Label1: TLabel;
  15. Edit2: TEdit;
  16. procedure Button1Click(Sender: TObject);
  17. private
  18. { Private declarations }
  19. public
  20. { Public declarations }
  21. end;
  22.  
  23. var
  24. Form4: TForm4;
  25.  
  26. implementation
  27.  
  28. {$R *.dfm}
  29.  
  30. procedure TForm4.Button1Click(Sender: TObject);
  31. begin
  32. Edit1.Text :=
  33. IntToStr(StrToInt(Edit1.Text) + StrToInt(Edit2.Text));
  34. end;
  35.  
  36. end.
  37.  

Java:

  1.  
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.ui.Model;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RequestMethod;
  7. import javax.servlet.http.HttpServletRequest;
  8. import java.util.logging.Logger;
  9.  
  10. @Controller
  11. public class Unit4
  12. {
  13. Logger logger = Logger.getGlobal();
  14.  
  15. @Autowired
  16. private TForm4 Form4 = null;
  17.  
  18. @RequestMapping(value="/TForm4",method=RequestMethod.POST,
  19. params="Button1")
  20. public String Button1Click(HttpServletRequest request, Model model)
  21. {
  22. this.setPageValues(request);
  23. this.Form4.setEdit1Text(String.valueOf(
  24. Integer.parseInt(this.Form4.getEdit1Text())+
  25. Integer.parseInt(this.Form4.getEdit2Text())));
  26. this.addModelAttributes(model);
  27. return "TForm4";
  28. }
  29. public void setPageValues(HttpServletRequest request)
  30. {
  31. this.Form4.setEdit1Text(request.getParameter("Edit1"));
  32. this.Form4.setEdit2Text(request.getParameter("Edit2"));
  33. }
  34. public void addModelAttributes(Model model)
  35. {
  36. model.addAttribute("Edit1Text",this.Form4.getEdit1Text());
  37. model.addAttribute("Edit2Text",this.Form4.getEdit2Text());
  38. }
  39. }
  40.  

Pas conversion is based on form class autowiring and contains ButtonClick methods, setPageValues and addModelAttrributes, which set jsp values to their class representation and send them to the page respectively.

  • Converts Delphi Forms (*.dfm) Files to JSP and Java classes

Delphi:

  1.  
  2. object Form4: TForm4
  3. Left = 0
  4. Top = 0
  5. Caption = 'Form4'
  6. ClientHeight = 158
  7. ClientWidth = 201
  8. Color = clBtnFace
  9. Font.Charset = DEFAULT_CHARSET
  10. Font.Color = clWindowText
  11. Font.Height = -11
  12. Font.Name = 'Tahoma'
  13. Font.Style = []
  14. OldCreateOrder = False
  15. PixelsPerInch = 96
  16. TextHeight = 13
  17. object Label1: TLabel
  18. Left = 24
  19. Top = 107
  20. Width = 46
  21. Height = 13
  22. Caption = 'Summand'
  23. end
  24. object Button1: TButton
  25. Left = 24
  26. Top = 64
  27. Width = 153
  28. Height = 25
  29. Caption = 'Sum'
  30. TabOrder = 0
  31. OnClick = Button1Click
  32. end
  33. object Edit1: TEdit
  34. Left = 24
  35. Top = 37
  36. Width = 153
  37. Height = 21
  38. TabOrder = 1
  39. Text = '0'
  40. end
  41. object Edit2: TEdit
  42. Left = 76
  43. Top = 104
  44. Width = 101
  45. Height = 21
  46. TabOrder = 2
  47. Text = '0'
  48. end
  49. end
  50.  

Java:

  1.  
  2. package com.ispirer.controller.demo.Logic;
  3.  
  4. import org.springframework.stereotype.Controller;
  5. import org.springframework.ui.Model;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7.  
  8. @Controller
  9. public class TForm4
  10. {
  11. private String Edit1Text = null;
  12. private String Edit2Text = null;
  13.  
  14. public String getEdit1Text()
  15. {
  16. return Edit1Text;
  17. }
  18.  
  19. public void setEdit1Text(String edit1Text)
  20. {
  21. Edit1Text = edit1Text;
  22. }
  23.  
  24. public String getEdit2Text()
  25. {
  26. return Edit2Text;
  27. }
  28.  
  29. public void setEdit2Text(String edit2Text)
  30. {
  31. Edit2Text = edit2Text;
  32. }
  33.  
  34. @RequestMapping(value = "/TForm4")
  35. public String FormCreate(Model model)
  36. {
  37. this.Edit1Text = "0";
  38. model.addAttribute("Edit1Text",this.Edit1Text);
  39. this.Edit2Text = "0";
  40. model.addAttribute("Edit2Text",this.Edit2Text);
  41. return “TForm4";
  42. }
  43. }
  44.  

JSP:

  1.  
  2. <%@taglib prefix="c"
  3. uri="http://java.sun.com/jsp/jstl/core"%>
  4. <%@taglib prefix="form"
  5. uri="http://www.springframework.org/tags/form"%>
  6. <%@taglib prefix="mvc"
  7. uri="http://www.springframework.org/tags/form"%>
  8. <%@page contentType="text/html;charset=UTF-8" language="java"%>
  9. <html>
  10. <head>
  11. <title>Form4</title>
  12. <link rel="stylesheet" type="text/css"
  13. href="<c:url value="/resources/css/style.css"/>" />
  14. </head>
  15. <body>
  16. <div class="layout">
  17. <div class="left">
  18. </div>
  19. <div class="content">
  20. <form:form method="post">
  21. <label
  22. style="left:24px;top:107px;width:46px;height:13px;">Summand</label>
  23. <input type="submit" name="Button1" value="Sum"
  24. style="left:24px;top:64px; width:153px;height:25px;"/>
  25. <input type="text" name="Edit1" value="${Edit1Text}"
  26. style="left:24px;top:37px; width:153px;height:21px;"/>
  27. <input type="text" name="Edit2" value="${Edit2Text}"
  28. style="left:76px;top:104px; width:101px;height:21px;"/>
  29. </form:form>
  30. </div>
  31. <div class="right">
  32. </div>
  33. </div>
  34. </body>
  35. </html>
  36.  
Delphi Java
Migrate Delphi to Java Migrate Delphi to Java

Dfm files consist of various properties. For these scripts Ispirer MnMTK generates JSPs and Java classes. Delphi forms are converted to three columns JSP with content in <div class=”content”> tag and default css file for correct view of application. Also SQLWays creates model analogues of Delphi components as fields of class with get methods respectively. Properties of form are specified in FormCreate method.

  • Converts Delphi Data Access (BDE, ADO, etc.) to Java Database Access Frameworks (JDBC, Hibernate, Torque, etc.)

Delphi:

  1.  
  2. end object Form2: TForm2
  3. Left = 0
  4. Top = 0
  5. Width = 156
  6. Height = 198
  7. Caption = 'Test'
  8. Color = clBtnFace
  9. Font.Charset = DEFAULT_CHARSET
  10. Font.Color = clWindowText
  11. Font.Height = -11
  12. Font.Name = 'Tahoma'
  13. Font.Style = []
  14. OldCreateOrder = False
  15. PixelsPerInch = 96
  16. TextHeight = 13
  17. object DBGrid1: TDBGrid
  18. Left = 32
  19. Top = 8
  20. Width = 81
  21. Height = 120
  22. DataSource = DataSource1
  23. TabOrder = 0
  24. TitleFont.Charset = DEFAULT_CHARSET
  25. TitleFont.Color = clWindowText
  26. TitleFont.Height = -11
  27. TitleFont.Name = 'Tahoma'
  28. TitleFont.Style = []
  29. Columns = <
  30. item
  31. Expanded = False
  32. FieldName = 'col1'
  33. Visible = True
  34. end>
  35. end
  36. object ADOConnection1: TADOConnection
  37. Connected = True
  38. ConnectionString =
  39. 'Provider=MSDASQL.1;Persist Security Info=False;
  40. User ID=sa;Data S' +
  41. 'ource=MSSQL_VMDBSRV002_ETEST'
  42. Left = 24
  43. Top = 136
  44. end
  45. object ADOQuery1: TADOQuery
  46. Active = True
  47. Connection = ADOConnection1
  48. CursorType = ctStatic
  49. Parameters = <>
  50. SQL.Strings = (
  51. 'select col1 from tab1_test')
  52. Left = 56
  53. Top = 136
  54. end
  55. object DataSource1: TDataSource
  56. DataSet = ADOQuery1
  57. Left = 88
  58. Top = 136
  59. end
  60. end
  61.  

Java:

  1.  
  2. import java.sql.*;
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.ui.Model;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import util.TDBGrid;
  7.  
  8. @Controller
  9. public class TForm2
  10. {
  11. private TDBGrid DBGrid1 = null;
  12. private static String[] connectionString=
  13. {"jdbc:odbc:MSSQL_VMDBSRV002_ETEST","sa","" };
  14. public static Connection ADOConnection1()
  15. {
  16. try
  17. {
  18. return DriverManager.getConnection(
  19. connectionString[0],
  20. connectionString[1],
  21. connectionString[2]);
  22. }
  23. catch(SQLException e)
  24. {
  25. e.printStackTrace();
  26. }
  27. return null;
  28. }
  29. private PreparedStatement ADOQuery1 = null;
  30. private String ADOQuery1_SQL_Strings =
  31. "select col1 from tab2_test";
  32. private ResultSet DataSource1 = null;
  33. public void setADOQuery1(PreparedStatement ADOQuery1)
  34. {
  35. this.ADOQuery1 = ADOQuery1;
  36. }
  37. public PreparedStatement getADOQuery1()
  38. {
  39. return this.ADOQuery1;
  40. }
  41. public void setADOQuery1_SQL_Strings(String ADOQuery1_SQL_Strings)
  42. {
  43. this.ADOQuery1_SQL_Strings = ADOQuery1_SQL_Strings;
  44. }
  45. public String getADOQuery1_SQL_Strings()
  46. {
  47. return this.ADOQuery1_SQL_Strings;
  48. }
  49. public void setDataSource1(ResultSet DataSource1)
  50. {
  51. this.DataSource1 = DataSource1;
  52. }
  53. public ResultSet getDataSource1()
  54. {
  55. return this.DataSource1;
  56. }
  57. public void initDBGrid1(Model model)
  58. {
  59. this.DBGrid1 = new TDBGrid(this.DataSource1,new String[]
  60. { "col1" });
  61. this.DBGrid1.initDBGridModel();
  62. model.addAttribute("DBGrid1",this.DBGrid1.getDBGridModel());
  63. model.addAttribute("DBGrid1ColWidth",new Integer[] { 100 });
  64. }
  65. @RequestMapping(value = "/TForm2")
  66. public String FormCreate(Model model)
  67. {
  68. try
  69. {
  70. this.ADOQuery1 =
  71. ADOConnection1().prepareStatement(getADOQuery1_SQL_Strings(),
  72. ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
  73. }
  74. catch(SQLException e)
  75. {
  76. e.printStackTrace();
  77. }
  78. try
  79. {
  80. this.DataSource1 = this.ADOQuery1.executeQuery();
  81. }
  82. catch(SQLException e)
  83. {
  84. e.printStackTrace();
  85. }
  86. initDBGrid1(model);
  87. return "TForm2";
  88. }
  89. }
  90.  
Delphi Java
Migrate Delphi to Java Migrate Delphi to Java

It’s an example of Ispirer MnMTK DBGrid conversion with usage of TADOConnection, TADOQuery and TDataSource. As a result SQLWays generates JSP with stylized table filled from database. Also SQLWays can automatically generate Hibernate, Torque XML maps according to database tables.


Why Ispirer MnMTK?

SQLWays automates the entire migration process of your current Delphi application to Java. Moreover, with SQLWays you eliminate most of associated risks and considerably reduce internal efforts. All these benefits are available at very reasonable and competitive costs, which makes SQLWays even more attractive instrument for this project type.

Our conversion technology ensures:

  • Readable and Maintainable Code
    Generating readable and maintainable code with manual conversion quality
  • Code Transformation and Refactoring
    Transforming code implementing best practices of Java rather than emulating old technology on the new platform
  • Latest Technologies
    Using advantages and Java frameworks and technologies
  • Pure Java Code
    No any Ispirer libraries or IP used after conversion

SQLWays is effective to convert large scripts containing thousands or millions lines of code:

  • Automatically Resolves Dependencies
    Can extract information from dependent files, database etc. to automatically resolve dependencies and conflicts
  • Configurations
    Can read information from various configuration and projects files (SQLWays configuration files, .xml files)
  • Fast and Powerful Customization
    Abstract layers, re-usable conversion templates, internal conversion language and tools allow fast customization and complex code transformations.

You can download Delphi source code samples and the results of conversion:

Our Approach

Please complete the questionnaire to initiate collaboration discussions for your project or get some rough estimation:

For ISV companies Ispirer offers comprehensive Engagement model to convert applications with millions lines of code.

If you are interested in these migration services, please contact us for more information.

 
Testimonials
December 3, 2012Epicor Software Corporation, United States
Progress 4GL to C# .Net Migration

"Epicor has engaged with the Ispirer team to create and refine prototype techniques for migrating certain parts of the Epicor Progress ABL code to well...

...

Case Studies
May 26, 2014COBOL to .NET Conversion, United States

Our client was a major player in market-driven innovation and science. For more than two hundred years, it has been presenting world-class science and engineering to the global marketplace...

...

September 12, 2014Delphi to C# .NET, United States

Our client was a U.S.-based health insurance company providing care services since six decades through its extensive network of hospitals and other institutions.

...

Feedback

I just want to touch base with you to let you know that the tool is doing great work so far.

Read more
Industry Events