JS连接Oracle

<script language=javascript>  

 


//容错问题,请读者自行进行判断。

//定义SQL语句

var sql = "select * from users";

//新建数据库连接对象和数据集存取对象

var ConnDB = new ActiveXObject("ADODB.Connection");

ConnDB.open("Provider=MSDAORA.1;Password=mdj;User ID=mdj;Data Source=ORCL;Persist Security Info=True");

var rs =  new ActiveXObject("ADODB.Recordset");
rs.ActiveConnection = ConnDB;
rs.Open(sql);

//遍历

var s;
while(!rs.EOF){
  
  
   for(i = 0;i<rs.Fields.Count;++i){
  alert(rs.Fields(i).value);
  }
  rs.MoveNext();
}


var sql=null;

rs.close

ConnDB.close

 

 

</script>

你可能感兴趣的:(oracle,sql,数据库,Security)