Skip to content

Commit 13d7cdf

Browse files
author
18746521060
committed
Updates chapter1.md
Auto commit by GitBook Editor
1 parent 27f3d0c commit 13d7cdf

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

chapter1.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,24 @@ conn.commit()
2828
# 关闭连接
2929
conn.close()
3030
```
31-
# python连接oracle > 下载对应版本的cx_Oracle。具体步骤如下 > 1. 引用cx_Oracle 2. 连接数据库 3. 获取cursor 4. 使用cursor进行各种操作 5. 关闭cursor 6. 关闭连接 **例子如下:** ``` import cx_Oracle conn = cx_Oracle.connect('用户名/密码@主机/数据库') c = conn.cursor() x = c.execute('select * from test1') # 输出查询结果-->先进先出 x.fetchone() c.close() conn.close() ```
31+
# python连接oracle
32+
> 下载对应版本的cx_Oracle。具体步骤如下
33+
>
34+
1. 引用cx_Oracle
35+
2. 连接数据库
36+
3. 获取cursor
37+
4. 使用cursor进行各种操作
38+
5. 关闭cursor
39+
6. 关闭连接
40+
41+
**例子如下:**
42+
```python
43+
import cx_Oracle
44+
conn = cx_Oracle.connect('用户名/密码@主机/数据库')
45+
c = conn.cursor()
46+
x = c.execute('select * from test1')
47+
# 输出查询结果-->先进先出
48+
x.fetchone()
49+
c.close()
50+
conn.close()
51+
```

0 commit comments

Comments
 (0)