Use JDBC driver in Powerbuilder

Source: Internet
Author: User

Recently, the ghost had the idea of jdbc, because it was necessary to integrate the oracle driver into the software.

This is a common problem, but I am not prepared to solve it in a common way.

The common method is to get a "simplified" oracle client (you need to write the Registry) or directly connect to the client from oracle (you need to configure the tnsname file)

Or simply integrate the oracle odbc driver (requires registration and configuration)

I used powerbuilder and used it in common methods. This time I am going to work hard on jdbc supported by pb10.5. The process is as follows:

1. jdbc for oracle is configured locally. (jvm and classpath must be set in pb)

2. Implementation in the production environment: Install jre and set JAVA_HOME/CLASSPATH (all written in instructions, nothing special)

3. Start to simplify

A. jre problem: jre does not need to be installed. Set JAVA_HOME.

So I copied the jre directory to the program directory, and accidentally found that as long as the name is jre, I can find it without setting JAVA_HOME. (I learned that most of the jre software can do this)

B. classpath: The classpath must be set. Otherwise, the jdbc driver cannot be found (this is what is written on the book and on the Internet)

But I don't want to do this. Why)

As a result, I learned from tests that if I put the. jar file of the jdbc driver into the program running directory, I can find

I thought the problem was solved. Later I found that if the directory name is Chinese, I still cannot find it (the evil Latin text)

Start your brains again (I will not do anything else)

It is found that the jvm will load files in rt. jar during initialization (I guess rt is the meaning of runtime). Many people are trying to streamline rt. jar, most of which are for ease of deployment.

I also found that the. jar file is in the zip format (this world knows)

So ......

C. Unfortunately, a jar file in the jdbc support library of pb may not be found in the Chinese directory.

Kill Buddha with God, and kill Buddha with Buddha

4. jdbc Application Experience

The advantage of using jdbc is that it does not need to be registered, configured, and compatible.

Disadvantages:

A. the startup is a little slow, but the current computer is only delayed for about half a second, which can be ignored.

B. pb's database canvas cannot use all the jdbc features. The design efficiency is low, but the execution is fine.

C. The software package is larger than the original one, but it can be reduced by streamlining jre. However, sun is said to be unhappy.

 

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.