-1

I am having difficulty trying to get the tnsname.ora file to do the following:

  1. I managed to get the JComboBox populated with the data from the service_name

  2. My next question is the following:

a. How does one populate the CORRECT/appropriate host name (e.g. 127.0.0.3) if the specific service_name is selected on the JCombobox.

i. I know this can be done using a itemStateChanged(ItemEvent ie), and I can make it action so populates data whenever one selects a different service name. But the question is HOW or WHAT WAY can one do to do the following:

  1. If the service_name equals a certain SID

a. Then go and get populate the textboxes which store:

i. Host

ii. Port

iii. Protocol

I have my own theory how this could be done but do not know how to translate this to Java code:

  • If the service_name is selected

    • Go to previous line (4 steps back) where host details is populated
  • Populate the host data to the host textbox

    • Go to the previous line where the port is populated
  • Populate the port data to port textbox

NinjaLoop
  • 33
  • 8

1 Answers1

0

Isn't TNSNAMES.ORA just a plaintext file? Why not just read it and parse the values you need yourself?

In case you need it: https://docs.oracle.com/javase/tutorial/essential/io/

Aydin
  • 302
  • 3
  • 14