{"action":"created","issue":{"url":"https://api.github.com/repos/utPLSQL/utPLSQL-cli/issues/90","repository_url":"https://api.github.com/repos/utPLSQL/utPLSQL-cli","labels_url":"https://api.github.com/repos/utPLSQL/utPLSQL-cli/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/utPLSQL/utPLSQL-cli/issues/90/comments","events_url":"https://api.github.com/repos/utPLSQL/utPLSQL-cli/issues/90/events","html_url":"https://github.com/utPLSQL/utPLSQL-cli/issues/90","id":340121825,"node_id":"MDU6SXNzdWUzNDAxMjE4MjU=","number":90,"title":"Connection with TNS name doesn't work when DEFAULT_DOMAIN is defined in sqlnet.ora","user":{"login":"SebGt","id":28985083,"node_id":"MDQ6VXNlcjI4OTg1MDgz","avatar_url":"https://avatars1.githubusercontent.com/u/28985083?v=4","gravatar_id":"","url":"https://api.github.com/users/SebGt","html_url":"https://github.com/SebGt","followers_url":"https://api.github.com/users/SebGt/followers","following_url":"https://api.github.com/users/SebGt/following{/other_user}","gists_url":"https://api.github.com/users/SebGt/gists{/gist_id}","starred_url":"https://api.github.com/users/SebGt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SebGt/subscriptions","organizations_url":"https://api.github.com/users/SebGt/orgs","repos_url":"https://api.github.com/users/SebGt/repos","events_url":"https://api.github.com/users/SebGt/events{/privacy}","received_events_url":"https://api.github.com/users/SebGt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-07-11T07:23:46Z","updated_at":"2018-07-12T20:11:40Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\nFollowing the investigation done for #88 , I still have an issue with connection using TNSNAME.\r\n\r\nWhen TNS alias is defined without DEFAULT_DOMAIN it is working fine.\r\nCommand used is like : `utplsql run user/pswd@DB_TEST_DEV ...`\r\nConfig details:\r\n```\r\n# sqlnet.ora Network Configuration File\r\n\r\nSQLNET.AUTHENTICATION_SERVICES= (NTS)\r\nNAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)\r\n```\r\n```\r\n# tnsnames.ora File\r\n\r\nDB_TEST_DEV=\r\n  (DESCRIPTION =\r\n    (ADDRESS_LIST =\r\n      (ADDRESS = (COMMUNITY = tcp.world)(PROTOCOL = TCP)(Host = 10.1.1.1)(Port = 1550))\r\n    )\r\n    (CONNECT_DATA =\r\n      (SID = DB_T_DEV)\r\n    )\r\n  )\r\n```\r\nBut when DEFAULT_DOMAIN is defined, the alias is not found by java API used to connect:\r\nCommand used is like : `utplsql run user/pswd@DB_TEST_DEV ...`\r\n```\r\n...\r\nCaused by: oracle.net.ns.NetException: could not resolve the connect identifier  \"db_test_dev\"\r\n...\r\n```\r\nConfig details:\r\n```\r\n# sqlnet.ora Network Configuration File\r\nSQLNET.AUTHENTICATION_SERVICES= (NTS)\r\nTRACE_LEVEL_CLIENT = OFF\r\nNAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, ONAMES, HOSTNAME)\r\nLOG_DIRECTORY_CLIENT = c:\r\nNAMES.DEFAULT_DOMAIN = world\r\nSQLNET.EXPIRE_TIME = 0\r\nNAME.DEFAULT_ZONE = world\r\n```\r\n```\r\n# tnsnames.ora File\r\n\r\nDB_TEST_DEV.WORLD=\r\n  (DESCRIPTION =\r\n    (ADDRESS_LIST =\r\n      (ADDRESS = (COMMUNITY = tcp.world)(PROTOCOL = TCP)(Host = 10.1.1.1)(Port = 1550))\r\n    )\r\n    (CONNECT_DATA =\r\n      (SID = DB_T_DEV)\r\n    )\r\n  )\r\n```\r\n\r\nIn such config, connect string should be user/pswd@DB_TEST_DEV and when client opens the connection the TNS alias is determined using connect string + DEFAULT_DOMAIN in sqlnet.ora.\r\n\r\nIt seems that the java API doesn't use sqlnet.ora (googled but I found nothing about that).\r\nSo I tried to give the full alias name in connect string but API thought I pass an IP because there is a dot in connect string (it is what I guess)\r\nExample:\r\n `utplsql run user/pswd@DB_TEST_DEV.WORLD ...`\r\n```\r\n...\r\njava.sql.SQLRecoverableException: IO Error: Invalid connection string format, a valid format is: \"host:port:sid\"\r\n...\r\n```\r\n(see #88 for full stack)\r\n\r\nAny chance to have a look because config with DEFAULT_DOMAIN can't be changed ?\r\nThanks in advance.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/utPLSQL/utPLSQL-cli/issues/comments/404635703","html_url":"https://github.com/utPLSQL/utPLSQL-cli/issues/90#issuecomment-404635703","issue_url":"https://api.github.com/repos/utPLSQL/utPLSQL-cli/issues/90","id":404635703,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDYzNTcwMw==","user":{"login":"pesse","id":8362976,"node_id":"MDQ6VXNlcjgzNjI5NzY=","avatar_url":"https://avatars1.githubusercontent.com/u/8362976?v=4","gravatar_id":"","url":"https://api.github.com/users/pesse","html_url":"https://github.com/pesse","followers_url":"https://api.github.com/users/pesse/followers","following_url":"https://api.github.com/users/pesse/following{/other_user}","gists_url":"https://api.github.com/users/pesse/gists{/gist_id}","starred_url":"https://api.github.com/users/pesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pesse/subscriptions","organizations_url":"https://api.github.com/users/pesse/orgs","repos_url":"https://api.github.com/users/pesse/repos","events_url":"https://api.github.com/users/pesse/events{/privacy}","received_events_url":"https://api.github.com/users/pesse/received_events","type":"User","site_admin":false},"created_at":"2018-07-12T20:11:40Z","updated_at":"2018-07-12T20:11:40Z","author_association":"MEMBER","body":"I can reproduce it. SQLcl seems to overcome the issues, though."}}
{"actor":{"display_login":"pesse"}}