4 Replies Latest reply: Apr 21, 2012 3:13 PM by 925053 RSS

    problem to create acl in sql

    925053
      sir i m creating a ACL for data baase connection.
      but it give some error
      it the way i m follow writing in sqlplus:=

      CONN /AS SYSDBA
      connected
      BEGIN
      DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(
      acl => 'ULT_HTTP.xml',
      description => 'localhost ACL',
      principal => 'scott',
      is_grant => true,
      privilege => 'connect');
      DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(
      acl => 'ULT_HTTP.xml',
      host => 'localhost');
      END;
      /
      COMMIT;

      but sir it give error that :

      WRONG NO. OR TYPES OF ARGUMENTS IN CALL TO 'CREATE_ACL'
      or when i login to system and change the principal name => 'system'
      give error:=
      unresolve principal 'system'

      plz help me sir what i do

      Edited by: MAXIMUM on Apr 17, 2012 11:33 PM
        • 1. Re: problem to create acl in sql
          odie_63
          What's your database version? (SELECT * FROM v$version)
          • 2. Re: problem to create acl in sql
            925053
            sir i m succefully create the acl from system account
            the i dunning the program
            it give error:
            Network Adapter could not establish the connection
            what i do sir plz help me sir
            • 3. Re: problem to create acl in sql
              925053
              sir i m using oracle 11g
              my input file is:=
              <?xml version="1.0" ?>
              <employees>
              <employee>
              <empno>100</empno>
              <ename>Steven King</ename>
              <email>SKING</email>
              <bonus>3000</bonus>
              </employee>
              <employee>
              <empno>171</empno>
              <ename>William Smith</ename>
              <email>WSMITH</email>
              <bonus>2000</bonus>
              </employee>
              </employees>

              i m not know how i used that at which place in local host i m store my file and how?

              whaich listner is comptiable for that how to install that

              and at which place i store my input file

              my java code is :=/*
              * To change this template, choose Tools | Templates
              * and open the template in the editor.
              */
              package project;

              /**
              *
              * @author Kamal
              */

              import java.sql.Connection;
              import java.sql.DriverManager;
              import java.sql.ResultSet;
              import java.sql.Statement;
              //import oracle.jdbc.pool.OracleDataSource;
              /**
              *
              * @author RAHUL
              */
              public class Project {

              /**
              * @param args the command line arguments
              */
              public static void main(String[] args) {
              // TODO code application logic here
              try
              {
              Class.forName("oracle.jdbc.driver.OracleDriver");
              //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              System.out.println("-----------------------------------");
              Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORACLE","system","manager");
              //Connection conn = DriverManager.getConnection("jdbc:odbc:ORACLE","SCOTT","tiger");
              // System.out.println(conn);
              System.out.println("-----------------------------------");
              System.out.println("--------------------------------");
              //Connection conn = ods.getConnection();

              Statement stmt = conn.createStatement();
              String qry = "SELECT * FROM XMLTable("+
              "'for $i in $h/employees/employee " +
              "return $h' " +
              "PASSING xmlparse(document " +
              "httpuritype('http://localhost:8080//bonuses.xml').getCLOB()) as \"h\" )" ;
              System.out.println("-----------------------------------");
              ResultSet rs = stmt.executeQuery(qry);
              System.out.println("-----------------------------------");
              System.out.println("Bonuses:");
              while(rs.next())
              System.out.println(rs.getString(1) + ": $" + rs.getFloat(2));
              }



              catch(Exception e)
              {
              System.out.println(e);
              }

              }
              }


              error:=
              java.sql.SQLException: ORA-29273: HTTP request failed
              ORA-06512: at "SYS.UTL_HTTP", line 1819
              ORA-12541: TNS:no listener
              ORA-06512: at "SYS.HTTPURITYPE", line 34


              there is some problem realted to listner i m not able to doing plz help me.
              • 4. Re: problem to create acl in sql
                925053
                now that problem is over sir

                i m facing ner problem that sir
                how i give my input file to xqurery in java program in the form of url

                i explain sir:=
                that i store my inpurt file in tomcat server
                i want to give input to my xquery for xquery runnning one input file need that file i give to my xquery in the form of url that my file store i n tomcat server

                but i m note able to doing that what exactly correct way to give complete url as a input to my xquery

                for example:=

                String qry = "SELECT * FROM XMLTable("+
                "'for $i in $h/employees/employee " +
                "return $i '" +
                "PASSING xmlparse(document " +
                "httpuritype('http://localhost/bonuses.xml').getCLOB()) as \"h\"");


                like that sir i m give that but they give me error that httpuritype invalid identifier

                plz sir help me