最后一步了,和远程数据库交互编程。哈哈,说是交互编程,只负责登陆成功而已。第三步,程序中登陆远程数据库。1、验证unix有无配
有点空,和新上手occi的筒子们一起总结下。这篇内容其实挺有用的,对于新人来说不管哪一方面都是一个难点,如Oracle、unix、c++与occi、shell、makefile、随便挑出一个名词就能够让人学上一阵子了。这篇文章呢,咱就来个彻底的大剖析,目的是连通oracle并进行C++的应用编程,,并在这个基础上,对我们以后每个名词点的深入学习,提供入门的作用。
首先说一下我的环境,(注:大家的工作环境千差万别,但万变不离其宗,今天着重讲这个宗,所以不必拘泥于环境如何,看了我的操作,希望能使你举一反三,各种环境都能应对自如。)由于公司结构不得不形成如下的工作环境:
本人主机:windows+secureCRT,所以我都是在使用远程
工作主机:unix+oracle(本人是oracle服务器端,其实客户端的问题不大后详细解释。)
数据库服务器:我只知道主机ip、数据库用户名及密码,其他都不知道。应该是大型主机。
这种环境貌似是三方,而实际工作是两方,因为我是用windows+secureCRT远程连接到unix工作机上,在unix上编写c++程序调用occi连接远程数据库服务器。所以描述重心是后两者的工作。至于secureCRT(可以是其他ssh工具)连接到unix则需要unix主机的ip地址、用户名及密码即可。
好了,下面的所有工作都是从登陆unix工作机这一刻开始,目标是在unix上编写一段连接远程oracle数据库的c++代码编译、连接、运行成功。各个击破吧!
第一步:编译、连接、运行C++程序,保证C++环境正确。
判断C++环境正确很简单,写个helloworld.cpp程序。代码如:
这段代码要包含区别于c的元素,如using语句、cout等;
在shell里(sh、bash均可,个人更喜欢bash。)运行编译命令:
CC -c helloworld.cpp
(注意此处为大写的CC,小写的cc是编译c语言的)。结果会生成helloworld.o文件,继续运行连接命令:
CC -o helloworld.o
结果会默认生成a.out文件,此时当前目录下执行 ./a.out 出现打印的hello world!则为成功了(不要漏掉点和斜杠./),C++的编译环境就这样完成了。放心吧,unix默认都会支持CC的,至于gcc那是linux上的gnu项目开发的unix不一定支持。

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
