orafile

Java for dealing with Oracle SQL*Net .ora files

Лицензия

Лицензия

Группа

Группа

edu.gatech.gtri.orafile
Идентификатор

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

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

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

2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

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

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

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

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

https://github.com/gtri/orafile

Скачать orafile

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

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

Зависимости

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>
edu.gatech.gtri.orafile

Georgia Tech Research Institute

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

Версия
2.0
1.1.2