随笔分类 - Oracle Basic
SQL, Oracle Objects, Commands, etc.
摘要:1. 连接到OralceAt the operating system prompt, enter the following command to start the SQLCommand Line and connect to the database:CONN / AS SYSDBAThe slash (/) indicates that the database should authenticate you with operatingsystem authentication.也可以用 conn username/passwd as sysdbasystem/manager2. 启
阅读全文
摘要:Sequence: create / drop / and use..sql: @C:\XXX.sql;字符串中还有字符串用单引号....引用中问号用法:"<a href='show article deatile.jsp?id="+rs.getInt("id")+"' >"+rs.getString("cont")+"</a>"
阅读全文
摘要:今天准备完成DAO设计模式的测试,程序完成后却发现数据库怎么也连不上. 一直提示:The Network Adapter could not establish the connection.但是我用SQL PLUS却可以进行操作...不知道是何总原因.今天去Oracle的配置进行了进一步的研究.1.NetManager其中LISTENER表示对外的服务,就是监听的请求地址和端口.这是我自己的电脑,也就是LOCALHOST(127.0.0.1). 端口号为1522.(因为我还有一个Home1占用了1521端口).这里我们还可以新添加Host和Port,提供新的监听服务.2.命令启动或开启服务.
阅读全文
摘要:import java.sql.*; public class TestJDBC { public static void main(String[] args) throws Exception{ //1. Load the Driver //->1 Class.forName()|Class.forNmae().newInstance()|new DriverName() //->2 实例化时自动向DriverManager注册,不需要显示调用DriverManager.registerDriver方法 Class.forName("oracle.jdbc.drive
阅读全文
摘要:JDBC 连接参数: Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1522:ORCL", "scott","tiger");由于我机子上有home_1和home_2,home_2用的端口号是1522..所以这里是1522.服务名及端口号的问题在Oracle Net Manager中可以看到今天用sqlplus登录oracle数据库,一直用scott账号登录不成功.显示:“ORA-01034 -Oraclenot available”和
阅读全文