Reworked samples so that no default passwords are defined anywhere; a… · datamk/python-cx_Oracle@81583c2 · GitHub
Skip to content

Commit 81583c2

Browse files
Reworked samples so that no default passwords are defined anywhere; added
Python script to create sample schemas and drop them in addition to having a SQL*Plus script.
1 parent b8d5479 commit 81583c2

45 files changed

Lines changed: 866 additions & 649 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

samples/AdvancedQueuing.py

Lines changed: 2 additions & 2 deletions

samples/AdvancedQueuingNotification.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#------------------------------------------------------------------------------
2-
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
33
#------------------------------------------------------------------------------
44

55
#------------------------------------------------------------------------------
@@ -31,7 +31,7 @@ def callback(message):
3131
print("Queue name:", message.queueName)
3232
print("Consumer name:", message.consumerName)
3333

34-
connection = cx_Oracle.connect(SampleEnv.MAIN_CONNECT_STRING, events = True)
34+
connection = cx_Oracle.connect(SampleEnv.GetMainConnectString(), events = True)
3535
sub = connection.subscribe(namespace = cx_Oracle.SUBSCR_NAMESPACE_AQ,
3636
name = "BOOKS", callback = callback, timeout = 300)
3737
print("Subscription:", sub)

samples/AppContext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#------------------------------------------------------------------------------
2-
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
#
44
# Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved.
55
#
@@ -29,7 +29,7 @@
2929
( APP_CTX_NAMESPACE, "ATTR3", "VALUE3" )
3030
]
3131

32-
connection = cx_Oracle.connect(SampleEnv.MAIN_CONNECT_STRING,
32+
connection = cx_Oracle.connect(SampleEnv.GetMainConnectString(),
3333
appcontext = APP_CTX_ENTRIES)
3434
cursor = connection.cursor()
3535
for namespace, name, value in APP_CTX_ENTRIES:

samples/ArrayDMLRowCounts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#------------------------------------------------------------------------------
2-
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
#------------------------------------------------------------------------------
44

55
#------------------------------------------------------------------------------
@@ -18,7 +18,7 @@
1818
import cx_Oracle
1919
import SampleEnv
2020

21-
connection = cx_Oracle.connect(SampleEnv.MAIN_CONNECT_STRING)
21+
connection = cx_Oracle.connect(SampleEnv.GetMainConnectString())
2222
cursor = connection.cursor()
2323

2424
# show the number of rows for each parent ID as a means of verifying the

samples/BatchErrors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#------------------------------------------------------------------------------
2-
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
#------------------------------------------------------------------------------
44

55
#------------------------------------------------------------------------------
@@ -20,7 +20,7 @@
2020
import cx_Oracle
2121
import SampleEnv
2222

23-
connection = cx_Oracle.connect(SampleEnv.MAIN_CONNECT_STRING)
23+
connection = cx_Oracle.connect(SampleEnv.GetMainConnectString())
2424
cursor = connection.cursor()
2525

2626
# define data to insert

samples/BindInsert.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#------------------------------------------------------------------------------
2-
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
#------------------------------------------------------------------------------
44

55
#------------------------------------------------------------------------------
@@ -13,7 +13,7 @@
1313
import cx_Oracle
1414
import SampleEnv
1515

16-
connection = cx_Oracle.connect(SampleEnv.MAIN_CONNECT_STRING)
16+
connection = cx_Oracle.connect(SampleEnv.GetMainConnectString())
1717

1818
rows = [ (1, "First" ),
1919
(2, "Second" ),

samples/BindQuery.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#------------------------------------------------------------------------------
2-
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
#------------------------------------------------------------------------------
44

55
#------------------------------------------------------------------------------
@@ -17,7 +17,7 @@
1717
import cx_Oracle
1818
import SampleEnv
1919

20-
connection = cx_Oracle.connect(SampleEnv.MAIN_CONNECT_STRING)
20+
connection = cx_Oracle.connect(SampleEnv.GetMainConnectString())
2121

2222
cursor = connection.cursor()
2323
sql = 'select * from SampleQueryTab where id = :bvid'

samples/CQN.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#------------------------------------------------------------------------------
2-
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
#
44
# Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved.
55
#
@@ -50,7 +50,7 @@ def callback(message):
5050
print("-" * 60)
5151
print("=" * 60)
5252

53-
connection = cx_Oracle.connect(SampleEnv.MAIN_CONNECT_STRING, events = True)
53+
connection = cx_Oracle.connect(SampleEnv.GetMainConnectString(), events = True)
5454
sub = connection.subscribe(callback = callback, timeout = 1800,
5555
qos = cx_Oracle.SUBSCR_QOS_QUERY | cx_Oracle.SUBSCR_QOS_ROWIDS)
5656
print("Subscription:", sub)

samples/DMLReturningMultipleRows.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#------------------------------------------------------------------------------
2-
# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
33
#
44
# Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved.
55
#
@@ -22,7 +22,7 @@
2222
import SampleEnv
2323

2424
# truncate table first so that script can be rerun
25-
connection = cx_Oracle.connect(SampleEnv.MAIN_CONNECT_STRING)
25+
connection = cx_Oracle.connect(SampleEnv.GetMainConnectString())
2626
cursor = connection.cursor()
2727
print("Truncating table...")
2828
cursor.execute("truncate table TestTempTable")

samples/DRCP.py

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)