Pasoe x Mssql conection on linux

"I have a Linux server running Red Hat 9.6 and Progress 12.8.12, using the RDBMS and PASOE components.

I also have these packages on the server:

 

dotnet --info

.NET SDK:

 Version:      8.0.129

 Commit:      012cb88270

 Workload version: 8.0.100-manifests.e918bb24

 

Runtime Environment:

 OS Name:   ol

 OS Version: 9.6

 OS Platform: Linux

 RID:     ol.9-x64

 Base Path:  /usr/lib64/dotnet/sdk/8.0.129/

 

.NET workloads installed:

 Workload version: 8.0.100-manifests.e918bb24

There are no installed workloads to display.

 

Host:

 Version:   8.0.29

 Architecture: x64

 Commit:    18fd75c847

 

.NET SDKs installed:

 8.0.129 [/usr/lib64/dotnet/sdk]

 

.NET runtimes installed:

 Microsoft.AspNetCore.App 8.0.29 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]

 Microsoft.NETCore.App 8.0.29 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

 

Other architectures found:

 None

 

Environment variables:

 DOTNET_ROOT    [/usr/lib64/dotnet]

 

global.json file:

 Not found

 

Learn more:

 https://aka.ms/dotnet/info

 

Download .NET:

 https://aka.ms/dotnet/download

 

 

I'd like to know how I can test the connection from PASOE on Linux to a SQL Server database using JDBC or ODBC.

Is that possible? Do you have a quick example?


Roy Ellis likes this.
  • Matt Baker (Progress Software)

    JDBC? no. That's for java.

     

    OpenEdge can work with .NET and you'd likely have some success. At a bare minimum, you will need the mysql drivers. google can help here. translating the required connecting checks over to ABL from C# shouldn't be difficult.

     

  • Claudemir Santos (Customer)

    Tks, Matt.

     

    I'm trying to use this code: 

     

    /* Exemplo ABL - SQL Server via .NET ADO.NET */

     

    USING System.*.

    USING System.Data.*.

    USING System.Data.SqlClient.*.

     

    /* Defini‡Æo da string de conexÆo */

    DEFINE VARIABLE sqlConn as SqlConnection NO-UNDO.

    DEFINE VARIABLE sqlCmd AS SqlCommand NO-UNDO.

    DEFINE variable sqlReader AS SqlDataReader NO-UNDO.

    DEFINE VARIABLE connStr AS CHARACTER NO-UNDO.

     

    def var str-conexao   as char   no-undo.

     

    define var c-aux      as char   no-undo.

     

    find first rs-param-conex-sql 

         where rs-param-conex-sql.id-produto = "PROTHEUS"

            no-lock no-error.

     

    // + (if rs-param-conex-sql.port <> "" then ":" + rs-param-conex-sql.port else "")        

            

    assign str-conexao = "Server=" + rs-param-conex-sql.server + ";"

              + "Database=" + rs-param-conex-sql.database-sql + ";"          

              + "User Id=" + rs-param-conex-sql.user-id + ";" 

              + "Password=" + rs-param-conex-sql.passwd + ";".

     

    connStr = "Server=10.10.100.154\TOTVS;Database=PROTHEUS_HOMOLOGACAO;User Id=totvs;Password=totvs;".

     

    MESSAGE str-conexao skip

        connStr

      VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.

     

     

    do on error undo, leave:

     

      /* Cria conexÆo */

      sqlConn = new SqlConnection(str-conexao).

       

      sqlConn:open().   

       

      catch oneError as System.Data.SqlClient.SqlException:

        return "NOK".

      end catch.

       

    end.

     

    When using Windows, I need to include an assemblies.xml in the connection .pf. 

     

    <?xml version="1.0" encoding="utf-8"?>

    <references xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

     <assembly name="Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

     <assembly name="IKVM.OpenJDK.Core, Version=0.46.0.1, Culture=neutral, PublicKeyToken=13235d27fcbfff58" />

     <assembly name="IKVM.Runtime, Version=0.46.0.1, Culture=neutral, PublicKeyToken=13235d27fcbfff58" />

     <assembly name="proparse.net, Version=4.0.1.1105, Culture=neutral, PublicKeyToken=cda1b098b1034b24" />

     <assembly name="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

     <assembly name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

     <assembly name="ThoughtWorks.QRCode, Version=1.0.2774.19990, Culture=neutral, PublicKeyToken=null" />

    </references>

     

    But on Linux, I'm not exactly sure what to include in the XML file. 

     

     

     

     

     

     

  • Matt Baker (Progress Software)

    I see you have IKVM there in the assemblies. that means you have a .NET wrapper implementation around some Java .jar files? You also have proparse and thoughtworks. None of that seems important to what you are trying to do.

     

    Best I can tell is that you are running with .NET Framework (given you have system.data 4.0 in there.

     

    For linux. you'll be using .NET Core, not Framework. reads the docs. you'll need this (on either platform) to enable .NET usage.

     

    https://docs.progress.com/bundle/openedge-startup-and-parameter-reference/page/NET-Common-Language-Runtime-clrnetcore.html

     

    If you want to use .NET 8 you'll need this from the docs:

    https://docs.progress.com/bundle/openedge-gui-for-dotnet-in-abl/page/Adjust-the-OpenEdge-installation-to-use-a-different-.NET-version.html

     

    As far as the assemblies.xml on linux goes, you'll need (at a minimum, again I haven't tried it) the System.Data.Common. If it ships with .NET 8, then you just need to reference the assembly name. Don't include the version. So this basically to start with

     

     

    Here is the full resolved set of dependencies you'll need to use Microsoft.Data.SqlClient Version 7.0.2 (which is latest) for .NET 8.

     

    You'll need to download these packages from nuget.org (as they don't ship with .NET 8).

     

    I also suggest you bug your favorite PM and vote for this idea to make this process easier (I have a tool that resolves all this for you, but its not included with the product).

     

    https://openedge.ideas.aha.io/ideas/OPENEDGE-I-1474

    1. <?xml version="1.0" encoding="utf-8"?>
    2. <references>
    3. <assembly name="System.Security.Cryptography.Pkcs, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    4. <assembly name="System.Security.Cryptography.ProtectedData, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    5. <assembly name="System.Diagnostics.EventLog, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
    6. <assembly name="System.Configuration.ConfigurationManager, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
    7. <assembly name="Microsoft.SqlServer.Server, Version=1.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5" />
    8. <assembly name="System.IdentityModel.Tokens.Jwt, Version=8.16.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    9. <assembly name="Microsoft.IdentityModel.Protocols, Version=8.16.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    10. <assembly name="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=8.16.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    11. <assembly name="Microsoft.IdentityModel.Abstractions, Version=8.16.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    12. <assembly name="Microsoft.IdentityModel.Logging, Version=8.16.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    13. <assembly name="Microsoft.IdentityModel.Tokens, Version=8.16.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    14. <assembly name="Microsoft.IdentityModel.JsonWebTokens, Version=8.16.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    15. <assembly name="Microsoft.Extensions.Options, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" />
    16. <assembly name="Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" />
    17. <assembly name="Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" />
    18. <assembly name="Microsoft.Extensions.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" />
    19. <assembly name="Microsoft.Extensions.Caching.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" />
    20. <assembly name="Microsoft.Extensions.Caching.Memory, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" />
    21. <assembly name="Microsoft.Data.SqlClient.Internal.Logging, Version=7.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5" />
    22. <assembly name="Microsoft.Data.SqlClient.Extensions.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5" />
    23. <assembly name="Microsoft.Bcl.Cryptography, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
    24. <assembly name="Microsoft.Data.SqlClient, Version=7.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5" />
    25. </references>

     

    .

  • Peter Judge (Consultingwerk)

    Simplest way would be to test (if you can) using the tramlines/double bars/editor.

     

    First thing to do would be to make sure the client "sees" the .NET 8 runtime ...

    1. message
    2. System.Environment:Version:ToString()
    3. view-as alert-box.

    You will need to have the -clrnetcore startup parameter and possible followed this https://docs.progress.com/bundle/openedge-gui-for-dotnet-in-abl-128/page/Adjust-the-OpenEdge-installation-to-use-a-different-.NET-version.html .

  • Claudemir Santos (Customer)

    Tks Peter.

    Running the mentioned command, it returns the version.

    image 

    If I try to run a program that connects to the database, it gives an error.

     

    image 

     

    

     

     

     

    • Matt Baker (Progress Software)

      the first one means .net 8 is loading. the second means you don't have the right assemblies. Did you download them from nuget.org?

       

  • Claudemir Santos (Customer)

    Process completed:

     

    dnf install dotnet-sdk-8.0 -y

     

    Verify that everything is ok with:

     

    dotnet --version

    dotnet --info

     

    Create a project in a folder (for example, /opt/assemblies)

     

    dotnet new console

     

    Then:

     

    dotnet add package Microsoft.Data.SqlClient

     

    Locate the DLLs below and copy them to /opt/assemblies:

     

    Microsoft.Data.SqlClient.Extensions.Abstractions.dll

    Microsoft.Data.SqlClient.dll

    Microsoft.Data.SqlClient.Internal.Logging.dll

    System.Configuration.ConfigurationManager.dll

     

    Create an assemblies.xml file and place inside it:

     

    In your startup/connection parameter file (.pf), include:

     

    -clrnetcore

    -assemblies /opt/assemblies

     

    After this, I successfully connected to a SQL Server database.

     

    Thank you Matt and Peter for your help.

     

     

    • Matt Baker (Progress Software)

      nice. glad you got it working. i'm sure this will be a reference for future