Learning Oracle database programming in Linux

Source: Internet
Author: User

1. Introduction
Since PL/SQL cannot be used to develop applications for common users, you must use other languages or development tools. In Linux, what language or development tool should I use to develop Oracle database applications? This article introduces two solutions: Pro * C and JDBC. Another SQLJ method is omitted due to space limitations.

2. Environment Settings

2.1 software environment
The experiment environment in this article is in the Red Hat Linux 8.0 operating system. Because Oracle 9i requires at least MB of memory, we chose Oracle 8.1.7.0.1 as the database environment. Note: The typical installation of Oracle 8i does not include Pro * C. You need to select Pro * C in the development tool under the customized installation method. We chose to install JDK in J2SE 1.4.1 For Linux. In fact, JDK 1.1.6 and later versions can all be used.

2.2 Oracle user's environment variable settings
For convenience, all operations in this article are performed by logging on to Oracle users. The. bash_profile file of an Oracle user must contain the following lines:

# JAVA environment settings
Export CLASSPATH =.:/usr/local/java/lib:/usr/local/jre/lib
Export JAVA_HOME =/usr/local/java
# Oracle database environment settings
Export ORACLE_BASE =/home/oracle
Export ORACLE_HOME = $ ORACLE_BASE
Export ORACLE_SID = MyDB
Export ORACLE_TERM = vt100
Export ORACLE_OWNER = oracle
Export TNS_ADMIN = $ ORACLE_HOME/network/admin
# Set the compiling and running environment for JDBC and SQLJ
Export CLASSPATH =: $ CLASSPATH: $ ORACLE_HOME/jdbc/lib/classes111.zip
Export CLASSPATH =: $ CLASSPATH: $ ORACLE_HOME/jdbc/lib/nls_charset11.zip
Export CLASSPATH =: $ CLASSPATH: $ ORACLE_HOME/sqlj/lib/runtime12.zip
Export CLASSPATH =: $ CLASSPATH: $ ORACLE_HOME/sqlj/lib/translator.zip
# Set the search path
Export PATH = $ PATH:/usr/local/java/bin:/usr/local/jre/bin:/sbin
Export PATH = $ PATH:/usr/bin:/usr/sbin:/usr/local/bin: $ ORACLE_HOME/bin


2.3 create lab users and data tables
Create a new Oracle user test and create a student table that records student scores under the new user. This table is very simple and has only three fields: id, name, and score.

$ Sqlplus system/manager
SQL> create user test identified by test default tablspace users;
SQL> grant connect to test;
SQL> grant resource to test;
SQL> connect test/test;
SQL> create table student (id number, name varchar2 (20), score number );
SQL> insert into test values (1, 'zhang ', 95 );

Add some experiment data to the student table.

  • 1
  • 2
  • 3
  • Next Page
[Content navigation]
Page 1st: Oracle Database Programming in Linux Page 2nd: Oracle Database Programming in Linux
Page 3rd: Oracle Database Programming in Linux

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.