orafile

Java for dealing with Oracle SQL*Net .ora files

Лицензия

Лицензия

Группа

Группа

org.codeswarm
Идентификатор

Идентификатор

orafile
Последняя версия

Последняя версия

1.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

orafile
Java for dealing with Oracle SQL*Net .ora files
Ссылка на сайт

Ссылка на сайт

https://github.com/codeswarm/orafile
Система контроля версий

Система контроля версий

https://github.com/codeswarm/orafile

Скачать orafile

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.codeswarm/orafile/ -->
<dependency>
    <groupId>org.codeswarm</groupId>
    <artifactId>orafile</artifactId>
    <version>1.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.codeswarm/orafile/
implementation 'org.codeswarm:orafile:1.1.1'
// https://jarcasting.com/artifacts/org.codeswarm/orafile/
implementation ("org.codeswarm:orafile:1.1.1")
'org.codeswarm:orafile:jar:1.1.1'
<dependency org="org.codeswarm" name="orafile" rev="1.1.1">
  <artifact name="orafile" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.codeswarm', module='orafile', version='1.1.1')
)
libraryDependencies += "org.codeswarm" % "orafile" % "1.1.1"
[org.codeswarm/orafile "1.1.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.antlr : antlr-runtime jar 3.0.1

test (2)

Идентификатор библиотеки Тип Версия
commons-io : commons-io jar 2.0.1
org.testng : testng jar 6.2.1

Модули Проекта

Данный проект не имеет модулей.

orafile

Java for dealing with Oracle SQL*Net .ora files

Example usage

import edu.gatech.gtri.orafile.*;
import java.util.*;

public class OrafileDemo {

    public static void main(String[] args) throws Exception {

        // The sort of thing you might find in tnsnames.ora
        String tnsFileContent = "TheApplication =\n" +
            "  (ADDRESS = (PROTOCOL = TCP)(HOST = app-server)(PORT = 1521))\n" +
            "  (ADDRESS = (PROTOCOL = TCP)(HOST = app-server)(PORT = 1522))\n" +
            "  (CONNECT_DATA =(SID = banana)(SERVER = dedicated)))";

        // Parse the string.
        OrafileDict tns = Orafile.parse(tnsFileContent);

        System.out.println(tns); /* Output:

        THEAPPLICATION
          ADDRESS
            PROTOCOL: TCP
            HOST: app-server
            PORT: 1521
          ADDRESS
            PROTOCOL: TCP
            HOST: app-server
            PORT: 1522
          CONNECT_DATA
            SID: banana
            SERVER: dedicated
        */

        // Get the entry for "theapplication".
        OrafileVal theapplication = tns.get("theapplication").get(0);

        // Find ADDRESS entries and their HOST, PORT, and SID attributes.
        List<Map<String, String>> values = theapplication
            .findParamAttrs("address", Arrays.asList("host", "port", "sid"));

        System.out.println(values); /* Output:

        [{port=1521, sid=banana, host=app-server}, {port=1522, sid=banana, host=app-server}]
        */

        System.out.println(new OrafileRenderer().renderFile(tns)); /* Output:

        TheApplication =
          (ADDRESS =
            (PROTOCOL = TCP)
            (HOST = app-server)
            (PORT = 1521)
          )
          (ADDRESS =
            (PROTOCOL = TCP)
            (HOST = app-server)
            (PORT = 1522)
          )
          (CONNECT_DATA =
            (SID = banana)
            (SERVER = dedicated)
          )
        */
    }

}

Download

Orafile is available from Maven Central.

<dependency>
  <groupId>edu.gatech.gtri.orafile</groupId>
  <artifactId>orafile</artifactId>
  <version>2.0</version>
</dependency>
org.codeswarm

Codeswarm

Версии библиотеки

Версия
1.1.1
1.1
1.0