Oracle
 sql >> Teknologi Basis Data >  >> RDS >> Oracle

Bagaimana saya bisa terhubung ke database Oracle berbasis web dengan Java?

Gunakan:

Connection connection = null;

try {
   // Load the JDBC driver
   String driverName = "oracle.jdbc.driver.OracleDriver";
   Class.forName(driverName);

   // Create a connection to the database
   String serverName = "127.0.0.1";
   String portNumber = "1521";
   String sid = "mydatabase";
   String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
   String username = "username";
   String password = "password";
   connection = DriverManager.getConnection(url, username, password);
} catch (ClassNotFoundException e) {
   // Could not find the database driver
} catch (SQLException e) {
   // Could not connect to the database
}

Referensi:Menghubungkan ke Database Oracle



  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. GWFG di Oracle RAC

  2. Menghubungkan ke database Oracle 10g melalui R

  3. SQL Oracle:Ganti hasil kosong dengan kata

  4. plsql - cara mengembalikan array asosiatif ke java

  5. Cara Menemukan Nama Batasan di Oracle