Plsql can be used to connect to oracle, but OCILogon cannot connect to oracle.

Source: Internet
Author: User
Plsql can be used to connect to oracle, but OCILogon cannot be used to connect to oracle. I used to use this program to connect to oracle. but now I cannot connect to oracle. I have no idea why. hope you can enlighten me. the source code is as follows. only the correct IP address is modified, because Database security is involved. could you please help me to see if this code is wrong? Code: $ plsql can be used to connect to oracle, but OCILogon cannot connect to oracle.
I used to use this program to connect to the connection, but now the connection is no longer available and I have no idea why. hope you can enlighten me. the source code is as follows. only the correct IP address is modified, because Database security is involved. could you please help me to see if this code is wrong?
Code:
$ Dbconn = OCILogon ("zdext", "zd # 0228ea2l", "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = *******) (PORT = 1521) (CONNECT_DATA = (SID = ORCL) ") or die ('database connection failed ');

I always failed to connect to the database, but it was hard to understand when I used plsql to connect to the database!

------ Solution --------------------
Print_r (oci_error ());
Why do you always prefer to handle errors on your own!
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.