Parser for tnsnames.ora files

Parser for Oracle tnsnames.ora file configuration

Лицензия

Лицензия

Группа

Группа

com.github.a-langer
Идентификатор

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

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

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

0.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Parser for tnsnames.ora files
Parser for Oracle tnsnames.ora file configuration
Ссылка на сайт

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

https://github.com/a-langer/oraconf
Система контроля версий

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

https://github.com/a-langer/oraconf

Скачать oraconf

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

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

Зависимости

test (4)

Идентификатор библиотеки Тип Версия
org.junit.jupiter : junit-jupiter-engine jar 5.6.2
org.junit.vintage : junit-vintage-engine jar 5.6.2
org.mockito : mockito-core jar 3.3.3
com.google.code.gson : gson jar 2.8.6

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

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

Build Status license Maven JitPack Maven Central

Parser for tnsnames.ora files

Library oraconf-<version>.jar enables working with files in Oracle configuration format as described by documentation. This project is a fork of oraconf.

Supported features:

  • Parsing tnsnames.ora files.
  • Query a parsed file to retrieve a specific entry.
  • Manipulating the parsed entries.
  • Constructing new entries.
  • Serializing parsed/new entries in a unified format that can be saved back to a file.
  • Export to JSON format (including command line).
  • No dependency on third-party libraries.

Getting the library using Maven

Add this dependency to your pom.xml to reference the library:

<dependency>
    <groupId>com.github.a-langer</groupId>
    <artifactId>oraconf</artifactId>
    <version>0.0.1</version>
</dependency>

Usage

Print all entries in a test.ora tnsnames file:

import java.io.FileNotFoundException;
import java.io.IOException;
import com.github.alanger.oraconf.ConfigurationParameter;
import com.github.alanger.oraconf.ConfigurationFile;
import com.github.alanger.oraconf.Parser;
import com.github.alanger.oraconf.ParameterFile;

public class Main {
    public static void main(String[] args) throws FileNotFoundException, IOException {
        ConfigurationFile cFile = new Parser(new ParameterFile("test.ora")).parse();
        for(ConfigurationParameter cp : cFile.getParameters()) {
            System.out.println( cp.toString() );
        }
    }
}

Parse a tnsnames file and find a specific entry by parameter printing it to stdout:

cFile = new Parser(cFile).parse();
System.out.println(cFile.findParameter(new Parameter("Area52")).toString());

Parse a tnsnames file and find a specific entry by name printing it to stdout:

cFile = new Parser(cFile).parse();
System.out.println(cFile.findParameter("Area52").toString());

Parse a tnsnames file and find a specific entry by name printing it to stdout as JSON:

cFile = new Parser(cFile).parse();
System.out.println(cFile.findParameter("Area52").toJson());

Export to JSON from command line using oraconf-*.jar:

java -jar ./oraconf-*.jar /etc/tns_admin/tnsnames.ora > tnsnames.json

Related resources

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

Версия
0.0.1