What will be connection string when creating a custom mapplet to connect to Oracle server?

  • 0
  • 1
  • Question
  • Updated 7 days ago
  • In Progress

I am trying to reuse a mapplet and trying to connect to Oracle Db instead of DB2(as was in the original mapplet). But every time I am getting an error - Error connecting to database: (using class oracle.jdbc.driver.OracleDriver) " and  "Invalid connection string format, a valid format is: "host:port:sid" . I have put the beloe details :

<name>LOOKUP</name>

    <server>CORRECT_ORACLE_SERVER_NAME</server>

    <type>ORACLE</type>

    <access>Native</access>

    <database>SCHEMA_NAME</database>

    <port>PORT</port>

    <username>USER_NAME</username>

    <password>PASSWORD</password>

    <servername/>

With the above credentials (intentioanly not provided here) I am bale to connect to Oracle DB using SQL Developer , but not through Delphix.

Any help is highly appreciated.

Thanks,

Supriyo Bhattacharya

Photo of SUPRIYO

SUPRIYO

  • 90 Points 75 badge 2x thumb

Posted 7 days ago

  • 0
  • 1
Photo of Tim Gorman

Tim Gorman, Field Services

  • 3,184 Points 3k badge 2x thumb
Supriyo,

I am not familiar with the XML file you're using, but I believe that your problem is in the entry for the "<database>SCHEMA_NAME</database>".  In Oracle, I believe that "database" would be the value of the $ORACLE_SID environment variable (a.k.a. instance ID).

I also see you terminating "servername" but not opening it, but maybe that is irrelevant.

Anyway, the XML you displayed provides "host" and "port", but not "sid", so that is the missing piece.

Hope this helps...

-Tim
Photo of SUPRIYO

SUPRIYO

  • 90 Points 75 badge 2x thumb
I was trying to provide HOSTNAME:PORT:SID in the server element.But that did not work too. Also the code i provided works with DB2 server.I just copied it and trying to use for Oracle :) 
Photo of Tim Gorman

Tim Gorman, Field Services

  • 3,184 Points 3k badge 2x thumb
Supriyo,

Again, I'm unsure where that XML code comes from, but I'm guessing it might be different for Oracle.  There are two main formats for thin JDBC connect strings to Oracle...

  1. jdbc:oracle:thin:username/password@//host:port:sid
  2. jdbc:oracle:thin:username/password@//host:port/service

Please note that the only difference between the two formats is at the end of the string, with ":sid" and "/service".

So it may be possible that your XML specification might work if the "database" tag is replaced with either "sid" or "service" as labels?

Please let me know what you think?

Thanks!

-Tim
Photo of Gianpiero Piccolo

Gianpiero Piccolo

  • 1,538 Points 1k badge 2x thumb
Hi SUPRIYO,

it depends how the custom mapplet was written. We don't have source of this custom mapplet. Maybe the mapplet was written making a connection string with DB2 jdbc specification.

I think you have to ask for a more general mapplet to the mapplet author. Maybe instead of collecting separated parameters, it should directly collect the connection string.

Regards.
Gianpiero
Photo of SUPRIYO

SUPRIYO

  • 80 Points 75 badge 2x thumb
Yes. I too feel the same way. Is there any free editor in Delphix for creating these mapplets where I can test connection strings ?