diff --git a/java/AoJ/README.md b/java/AoJ/README.md
index d3df9b44..9a01a540 100755
--- a/java/AoJ/README.md
+++ b/java/AoJ/README.md
@@ -55,10 +55,10 @@ To run the sample file you will need a SQL database and corresponding JDBC drive
has been run with [Oracle Database 12c](http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html)
and [Oracle Database 12c JDBC](http://www.oracle.com/technetwork/database/application-development/jdbc/downloads/index.html),
but it should work with any reasonably standard compliant SQL database and JDBC
-driver. The sample file uses the scott/tiger schema available
-[here](https://github.com/oracle/dotnet-db-samples/blob/master/schemas/scott.sql).
+driver. The sample file uses the table 'emp' and 'dept'. So, you can create a user "testuser" and 'emp' and 'dept' tables using
+[JDBCSampleData.sql](https://github.com/oracle/oracle-db-examples/blob/master/java/jdbc/BasicSamples/JDBCSampleData.sql).
-Start the database and load ```scott.sql```. Edit ```com.oracle.adbaoverjdbc.test.FirstLight.java```
+Start the database and make sure to create 'testuser' and needed tables using [JDBCSampleData.sql](https://github.com/oracle/oracle-db-examples/blob/master/java/jdbc/BasicSamples/JDBCSampleData.sql). Edit ```com.oracle.adbaoverjdbc.test.FirstLight.java```
and set the constant ```URL``` to an appropriate value. AoJ will pass this value
to ```java.sql.DriverManager.getSession```. If you are using a database other
than Oracle you should change the value of the constant ```TRIVIAL``` to some
@@ -67,7 +67,7 @@ very trivial ```SELECT``` query.
## Sample Code
The following test case should give you some idea of what AoJ can do. It should
-run with any JDBC driver connecting to a database with the scott schema. This is
+run with any JDBC driver connecting to a database with the 'testuser' schema. This is
the last test in ```com.oracle.adbaoverjdbc.test.FirstLight.java```. For an
introduction to ADBA see the
[JavaOne 2017 presentation](http://www.oracle.com/technetwork/database/application-development/jdbc/con1491-3961036.pdf).
diff --git a/java/AoJ/src/README.md b/java/AoJ/src/README.md
index 79ea671d..4e6f06ff 100755
--- a/java/AoJ/src/README.md
+++ b/java/AoJ/src/README.md
@@ -50,10 +50,9 @@ To run the sample file you will need a SQL database and corresponding JDBC drive
has been run with [Oracle Database 12c](http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html)
and [Oracle Database 12c JDBC](http://www.oracle.com/technetwork/database/application-development/jdbc/downloads/index.html),
but it should work with any reasonably standard compliant SQL database and JDBC
-driver. The sample file uses the scott/tiger schema available
-[here](https://github.com/oracle/dotnet-db-samples/blob/master/schemas/scott.sql).
+driver. The sample file uses the table 'emp' and 'dept'. So, you can create a user "testuser" and 'emp' and 'dept' tables using [JDBCSampleData.sql](https://github.com/oracle/oracle-db-examples/blob/master/java/jdbc/BasicSamples/JDBCSampleData.sql).
-Start the database and load ```scott.sql```. Edit ```com.oracle.adbaoverjdbc.test.FirstLight.java```
+Start the database and make sure to create 'testuser' and needed tables using [JDBCSampleData.sql](https://github.com/oracle/oracle-db-examples/blob/master/java/jdbc/BasicSamples/JDBCSampleData.sql). Edit ```com.oracle.adbaoverjdbc.test.FirstLight.java```
and set the constant ```URL``` to an appropriate value. AoJ will pass this value
to ```java.sql.DriverManager.getSession```. If you are using a database other
than Oracle you should change the value of the constant ```TRIVIAL``` to some
@@ -62,7 +61,7 @@ very trivial ```SELECT``` query.
## Sample Code
The following test case should give you some idea of what AoJ can do. It should
-run with any JDBC driver connecting to a database with the scott schema. This is
+run with any JDBC driver connecting to a database with the 'testuser' schema. This is
the last test in ```com.oracle.adbaoverjdbc.test.FirstLight.java```. For an
introduction to ADBA see the
[JavaOne 2017 presentation](http://www.oracle.com/technetwork/database/application-development/jdbc/con1491-3961036.pdf).
diff --git a/java/AoJ/test/com/oracle/adbaoverjdbc/test/SessionPropertyTest.java b/java/AoJ/test/com/oracle/adbaoverjdbc/test/SessionPropertyTest.java
index 04576fdb..68808542 100755
--- a/java/AoJ/test/com/oracle/adbaoverjdbc/test/SessionPropertyTest.java
+++ b/java/AoJ/test/com/oracle/adbaoverjdbc/test/SessionPropertyTest.java
@@ -38,7 +38,7 @@ public void testUser() {
assertEquals("USER", USER.name());
assertEquals(String.class, USER.range());
assertFalse(USER.validate(1234));
- assertTrue(USER.validate("SCOTT"));
+ assertTrue(USER.validate("testuser"));
assertNull(USER.defaultValue());
assertFalse(USER.isSensitive());
}
diff --git a/java/AoJ/test/com/oracle/adbaoverjdbc/test/TestConfig.java b/java/AoJ/test/com/oracle/adbaoverjdbc/test/TestConfig.java
index 1f3bb294..48eccc9f 100755
--- a/java/AoJ/test/com/oracle/adbaoverjdbc/test/TestConfig.java
+++ b/java/AoJ/test/com/oracle/adbaoverjdbc/test/TestConfig.java
@@ -38,7 +38,7 @@
* For example, this -D command line option would configure the database user:
*
*
- * java -Dcom.oracle.adbaoverjdbc.test.TestConfig.USER=SCOTT ...
+ * java -Dcom.oracle.adbaoverjdbc.test.TestConfig.USER=testuser ...
*
*
* For convenience, configurable values can be identified by their short name,
@@ -46,7 +46,7 @@
* example, this -D command line option would also configure the database user:
*
*
- * java -DUSER=SCOTT ...
+ * java -DUSER=testuser ...
*
*
* While convenient, potential collisions can arise if some other component
diff --git a/java/jdbc/BasicSamples/JDBCSampleData.sql b/java/jdbc/BasicSamples/JDBCSampleData.sql
index aed55ec4..931989b6 100755
--- a/java/jdbc/BasicSamples/JDBCSampleData.sql
+++ b/java/jdbc/BasicSamples/JDBCSampleData.sql
@@ -12,57 +12,20 @@ Rem
Rem MODIFIED (MM/DD/YY)
Rem nbsundar 04/06/18 - Created
-Rem Create a new user "jdbcuser" that will be used in all JDBC code samples
+Rem Create a new user "testuser" that will be used in all JDBC code samples
Rem Login as sysadmin before executing the script
-CREATE USER jdbcuser IDENTIFIED BY jdbcuser123;
+CREATE USER testuser IDENTIFIED BY testuser123;
-Rem Grant connect and resource access to the new "jdbcuser"
+Rem Grant connect and resource access to the new "testuser"
Rem so that the user can connect and create objects
-GRANT CONNECT, RESOURCE TO jdbcuser;
+GRANT CONNECT, RESOURCE TO testuser;
-Rem Grant required access to the new "jdbcuser"
-GRANT UNLIMITED TABLESPACE TO jdbcuser;
+Rem Grant required access to the new "testuser"
+GRANT UNLIMITED TABLESPACE TO testuser;
-Rem Switch the current session to the new jdbcuser session
-ALTER SESSION SET CURRENT_SCHEMA=jdbcuser;
+Rem Switch the current session to the new testuser session
+ALTER SESSION SET CURRENT_SCHEMA=testuser;
-Rem Used in the SQLXMLSample.java code sample
-CREATE TABLE SQLXML_JDBC_SAMPLE (DOCUMENT XMLTYPE, ID NUMBER);
-
-Rem Used in the PLSQLSample.java code sample
-CREATE TABLE PLSQL_JDBC_SAMPLE
- (NUM NUMBER(4) NOT NULL,
- NAME VARCHAR2(20) NOT NULL,
- INSERTEDBY VARCHAR2(20));
-
-Rem Used in LOBBasic.java code sample
-CREATE TABLE LOB_JDBC_SAMPLE
- (LOB_ID INT NOT NULL,
- BLOB_DATA BLOB,
- CLOB_DATA CLOB,
- NCLOB_DATA NCLOB);
-
-Rem Used in DateTimeStampSample.java code sample
-CREATE TABLE EMP_DATE_JDBC_SAMPLE
-(EMP_ID INTEGER PRIMARY KEY,
- DATE_OF_BIRTH DATE,
- DATE_OF_JOINING TIMESTAMP WITH LOCAL TIME ZONE,
- DATE_OF_RESIGNATION TIMESTAMP WITH TIME ZONE,
- DATE_OF_LEAVING TIMESTAMP);
-
-Rem Used in JSONBasicDemo.java code sample
-CREATE TABLE JSON_EMP_JDBC_SAMPLE
- (EMP_ID RAW(16) NOT NULL PRIMARY KEY,
- DATE_LOADED TIMESTAMP WITH TIME ZONE,
- EMPLOYEE_DOCUMENT CLOB CONSTRAINT
- ENSURE_JSON CHECK (EMPLOYEE_DOCUMENT IS JSON));
-
-Rem Used in JSONBasicDemo.java code sample
-INSERT INTO JSON_EMP_JDBC_SAMPLE VALUES (SYS_GUID(), SYSTIMESTAMP, '{"employee_number": 1, "employee_name": "John Doe", "salary": 2000}');
-INSERT INTO JSON_EMP_JDBC_SAMPLE VALUES (SYS_GUID(), SYSTIMESTAMP, '{"employee_number": 2, "employee_name": "Jane Doe", "salary": 2010}');
-INSERT INTO JSON_EMP_JDBC_SAMPLE VALUES (SYS_GUID(), SYSTIMESTAMP, '{"employee_number": 3, "employee_name": "John Smith", "salary": 3000, "sons": [{"name": "Angie"}, {"name": "Linda"}]}');
-INSERT INTO JSON_EMP_JDBC_SAMPLE VALUES (SYS_GUID(), SYSTIMESTAMP, '{"employee_number": 3, "employee_name": "Jane Williams", "salary": 1000, "sons": [{"name": "Rosie"}]}');
-
Rem General DEPT table for other code samples
CREATE TABLE DEPT
(DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,
@@ -102,6 +65,42 @@ INSERT INTO EMP VALUES(7900,'JAMES','CLERK',7698,to_date('3-12-1981','dd-mm-yyyy
INSERT INTO EMP VALUES(7902,'FORD','ANALYST',7566,to_date('3-12-1981','dd-mm-yyyy'),3000,NULL,20);
INSERT INTO EMP VALUES(7934,'MILLER','CLERK',7782,to_date('23-1-1982','dd-mm-yyyy'),1300,NULL,10);
+Rem Used in the SQLXMLSample.java code sample
+CREATE TABLE SQLXML_JDBC_SAMPLE (DOCUMENT XMLTYPE, ID NUMBER);
+
+Rem Used in the PLSQLSample.java code sample
+CREATE TABLE PLSQL_JDBC_SAMPLE
+ (NUM NUMBER(4) NOT NULL,
+ NAME VARCHAR2(20) NOT NULL,
+ INSERTEDBY VARCHAR2(20));
+
+Rem Used in LOBBasic.java code sample
+CREATE TABLE LOB_JDBC_SAMPLE
+ (LOB_ID INT NOT NULL,
+ BLOB_DATA BLOB,
+ CLOB_DATA CLOB,
+ NCLOB_DATA NCLOB);
+
+Rem Used in DateTimeStampSample.java code sample
+CREATE TABLE EMP_DATE_JDBC_SAMPLE
+(EMP_ID INTEGER PRIMARY KEY,
+ DATE_OF_BIRTH DATE,
+ DATE_OF_JOINING TIMESTAMP WITH LOCAL TIME ZONE,
+ DATE_OF_RESIGNATION TIMESTAMP WITH TIME ZONE,
+ DATE_OF_LEAVING TIMESTAMP);
+
+Rem Used in JSONBasicDemo.java code sample
+CREATE TABLE JSON_EMP_JDBC_SAMPLE
+ (EMP_ID RAW(16) NOT NULL PRIMARY KEY,
+ DATE_LOADED TIMESTAMP WITH TIME ZONE,
+ EMPLOYEE_DOCUMENT CLOB CONSTRAINT
+ ENSURE_JSON CHECK (EMPLOYEE_DOCUMENT IS JSON));
+
+Rem Used in JSONBasicDemo.java code sample
+INSERT INTO JSON_EMP_JDBC_SAMPLE VALUES (SYS_GUID(), SYSTIMESTAMP, '{"employee_number": 1, "employee_name": "John Doe", "salary": 2000}');
+INSERT INTO JSON_EMP_JDBC_SAMPLE VALUES (SYS_GUID(), SYSTIMESTAMP, '{"employee_number": 2, "employee_name": "Jane Doe", "salary": 2010}');
+INSERT INTO JSON_EMP_JDBC_SAMPLE VALUES (SYS_GUID(), SYSTIMESTAMP, '{"employee_number": 3, "employee_name": "John Smith", "salary": 3000, "sons": [{"name": "Angie"}, {"name": "Linda"}]}');
+INSERT INTO JSON_EMP_JDBC_SAMPLE VALUES (SYS_GUID(), SYSTIMESTAMP, '{"employee_number": 3, "employee_name": "Jane Williams", "salary": 1000, "sons": [{"name": "Rosie"}]}');
Rem commit the changes to the database
commit;
diff --git a/java/jdbc/BasicSamples/UCPMultiUsers.java b/java/jdbc/BasicSamples/UCPMultiUsers.java
index c4f72443..856d2322 100755
--- a/java/jdbc/BasicSamples/UCPMultiUsers.java
+++ b/java/jdbc/BasicSamples/UCPMultiUsers.java
@@ -42,9 +42,9 @@ public class UCPMultiUsers {
static String user = DEFAULT_USER;
static String password = DEFAULT_PASSWORD;
- // Modify these if user "scott" is locked in DB.
- final static String USER2 = "scott";
- final static String PASSWORD2 = "tiger";
+ // Modify these if user "testuser" is locked in DB.
+ final static String USER2 = "testuser";
+ final static String PASSWORD2 = "";
public static void main(String args[]) throws Exception {
getRealUserPasswordUrl(args);
diff --git a/java/ojvm/TrimLob.java b/java/ojvm/TrimLob.java
index 413410b2..03963cb7 100644
--- a/java/ojvm/TrimLob.java
+++ b/java/ojvm/TrimLob.java
@@ -44,8 +44,8 @@ public static void main (String args []) throws SQLException {
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
conn =
- DriverManager.getConnection("jdbc:oracle:thin:@localhost:1522/orcl", "scott",
- "tiger");
+ DriverManager.getConnection("jdbc:oracle:thin:@localhost:1522/orcl", "testuser",
+ "");
}
long t0,t1;
/*
diff --git a/java/ojvm/TrimLob.sql b/java/ojvm/TrimLob.sql
index 8da99f5b..a3575107 100644
--- a/java/ojvm/TrimLob.sql
+++ b/java/ojvm/TrimLob.sql
@@ -1,5 +1,5 @@
-REM replace scott/tiger with you database username/password
+REM Create a table basic_lob_table
REM
-connect scott/tiger;
+connect testuser/;
drop table basic_lob_table;
create table basic_lob_table (x varchar2 (30), b blob, c clob);
diff --git a/java/ojvm/TrimLobSp.sql b/java/ojvm/TrimLobSp.sql
index 1d94737a..3b6a9a9a 100644
--- a/java/ojvm/TrimLobSp.sql
+++ b/java/ojvm/TrimLobSp.sql
@@ -38,8 +38,8 @@ public class TrimLob
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
conn =
- DriverManager.getConnection("jdbc:oracle:thin:", "scott",
- "tiger");
+ DriverManager.getConnection("jdbc:oracle:thin:", "testuser",
+ "");
}
long t0,t1;
/*
diff --git a/java/ojvm/Workers_OJVM.sql b/java/ojvm/Workers_OJVM.sql
index e4858185..18ad3616 100644
--- a/java/ojvm/Workers_OJVM.sql
+++ b/java/ojvm/Workers_OJVM.sql
@@ -62,7 +62,7 @@ public class Workers
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
conn = DriverManager.getConnection("jdbc:oracle:thin:",
- "scott", "tiger");
+ "testuser", "");
System.out.println ("Running in JDK VM, outside the database!");
}
diff --git a/java/ojvm/Workers_jdbc.java b/java/ojvm/Workers_jdbc.java
index bed528f5..80fa4fc6 100644
--- a/java/ojvm/Workers_jdbc.java
+++ b/java/ojvm/Workers_jdbc.java
@@ -60,7 +60,7 @@ public static void main (String args []) throws SQLException {
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
conn = DriverManager.getConnection("jdbc:oracle:thin:",
- "scott", "tiger");
+ "testuser", "");
System.out.println ("Running in JDK VM, outside the database!");
}