Jump to content

connect to isqlpluss with php?


jokkis

Recommended Posts

I working with a system, whith java and java servlet, but I want to use php on the web-site instead of java servlet.

My question is how to connect to the oracle sqlpluss?

I use the sql server on my school...

 

in java its work like this:

 

public class KobleTilDb {
    
   private Connection con; 
   private String koblingsstreng = "jdbc:oracle:thin:@oracle.nith.no:1521:STUD";   
   public KobleTilDb(String user, String passw) {    
      try { 
         //Steg 1 - laste database driver    
         Class.forName("oracle.jdbc.driver.OracleDriver");   //1)  
          //Steg 2 - oppretter forbindelse til db gjennom DriverManager
         con = DriverManager.getConnection(
                koblingsstreng, user, passw);  //2)
      }
      catch ( ClassNotFoundException cnfex) { //koblet til 1)
       System.out.println("Feilet med å laste driveren: " + 
                                 cnfex.getMessage());
       System.exit(1);
      }
      catch ( SQLException sqlex) { //koblet til 2) og 3)
            System.out.println("Tilkobling ikke mulig: " + 
                               sqlex.getMessage());
    System.exit(1);
      }

   }

   public void lukkForbindelse() {
      try { 
         con.close();
      }
       catch ( SQLException sqlex) { //koblet til 2) og 3)
            System.out.println("Unable to disconnect.");
    System.exit(1);
      }
   }
   
   public Connection getConnection() { 
       return con;
  }
}

 

thats no problem, men I dont know how to do this in php

 

I hope someone can help:)

Link to comment
https://forums.phpfreaks.com/topic/95952-connect-to-isqlpluss-with-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.