与 java 的 Oracle 数据库连接

Oracle Database connectivity with java

连接码

username="system";
 password="oracle11";
 url="jdbc:oracle:thin:@localhost:1523:system";
 Driver="oracle.jdbc.driver.OracleDriver";
 Class.forName(this.Driver);
 this.con=DriverManager.getConnection(this.url,this.username,this.password);
 System.out.println("Connect");

在 url "system" 中全局连接到 oracle 它访问所有表所以没有数据库安全或分离所以如何区分 it.I 想要创建不同的数据库对于不同的项目如何在 oracle 中制作它以及如何使用 java

访问

试试这个:

打开CMD:
1. sqlplus / as sysdba;
2. 创建由 123 标识的用户测试;
3. 授予测试的所有权限;

此处:test为新用户,密码为123
现在当你需要用这个用户登录时
输入CMD:Sqlplus test/123

更正:
在 URL:
url="jdbc:oracle:thin:@localhost:1523:system";
最后一个参数应该是SID
通常服务ID是XE
url="jdbc:oracle:thin:@localhost:1523:XE";