JAVA 连接ORACLE数据库代码
import java.net.url;
import java.sql.*;
public class javaoracle {
public javaoracle() {
}
public static void main(string[] args){
try
{
try{
class.forname("oracle.jdbc.driver.oracledriver");
}
catch(java.lang.classnotfoundexception e)
{
system.err.print(e.getmessage());
}
string url="jdbc:oracle:thin:@server:1521:sdcdb";
connection conn=drivermanager.getconnection(url,"test","test");
statement stmt=conn.createstatement();
resultset rs=stmt.executequery("select score from my");
while(rs.next())
{
system.out.println(rs.getstring(1));
}
conn.close();
}
catch(sqlexception ex)
{
while(ex!=null)
{system.out.println(ex.getsqlstate());
}
}
}
}
///////////////////////
在try{}中: Class.forName("oracle.jdbc.driver.OracleDriver");
//将OracleDriver载入JVM对象池
抛出:ClassNotFoundException
3.连接数据库: Connection con=DriverManager.getConnection("jdbc:oracle:thin:ordertemp/ordetemp@localhost:1521:GY");
数据库类型标识符: jdbc:odbc:thin
登陆用户名: ordertemp
登陆密码: ordertemp
数据库服务器IP地址:localhost (或者用127.0.0.1,如果是网络,则为URL)
数据虚拟端口号: 1521 (oracle默认端口号) //(sqlserver默认端口号1433)
数据库SID: GY
抛出:SQLException
4.创建Statement对象(PreparedStatement也可以)
Statement stm=con.createStatement();
PreparedStatement psm=con.prepareStatement(String sql);
5.执行相关SQL查询语句及获得结果。
6.结束之后,必须使用: stm.close();  
相关文档:
SQL:结构化查询语言
C R U D: 增删改查
table : name age score
desc+表名 ---> 查询表结构
或者用 describe 命令 (desc是describe的简写)
查询语言:SELECT [DISTINCT] {*,column[alias],...} from table;
SELECT identifies what columns from identifies which tab ......
在启动oracle服务时,首先会在服务端找
1.spfile<sid>.ora
用于启动例程,如果找不到spfile<sid>.ora,则使用服务端缺省的
2.spfile
来启动,如果缺省的spfile也找不到,则使用
3.init<sid>.ora
来启动例程,最后则是使用缺省的
4.pfile
.当然你也可以指定pfile来覆盖缺省spfile启动例程,或通过spfile= ......
###author:hiphop###
###qq:70381908###
为什么要关注 Oracle ?
因为Oracle 被大量企业所使用,有许多目标可以选择来渗透
许多企业都没有更新且有潜在的方险!
提权非常简单,容易拿到shell!!
读了blackhat paper 让我开始来研究Oracle
因为他只讲到一小部份 真正安全问题还有很广的
只是国内好像很少挖掘
因为遇到 ......