Possible Software to Be Used (Cont.)


Oracle Database Management System (DBMS)
Oracle is an object-relational DBMS. The current version is 23ai, where the ‘ai’ stands for artificial intelligence. Ours is 21c, where the ‘c’ stands for cloud. Several database accesses are provided by the instructor:
JDBC (Java DataBase Connectivity)
It is a Java application programming interface for standard SQL access to databases.

Author:    

           
import  java.sql.*;
import  java.io.*;
import  oracle.jdbc.*;
import  oracle.jdbc.pool.OracleDataSource;

class  JDBC {
 public static void  main( String args[ ] ) throws SQLException {
  String user     = "C##user_id";
  String password = "password";
  String database = "20.185.147.112:1521/xe";
  OracleDataSource ods = new OracleDataSource( );
  ods.setURL     ( "jdbc:oracle:thin:@" + database );
  ods.setUser    ( user );
  ods.setPassword( password );
  Connection conn = ods.getConnection( );
  try {
   Statement stmt = conn.createStatement( );
   String query = "select unique title from inventory i, table(i.authors) j where ";
   for ( int i=0;  i<args.length;  i++ ) {
    if ( i != 0 )  query += " or ";
    query += "j.name like '%" + args[i].trim( ) + "%'";
   }
   ResultSet rset = stmt.executeQuery( query );
   while ( rset.next( ) )
    System.out.print( rset.getString( 1 ));
   rset.close( );
   stmt.close( );
  }
  catch ( SQLException ex ) {
   System.out.println( ex );
  }
  conn.close( );
 }
}




      Money doesn’t buy you happiness but it can buy you a jet-ski.    
      It is impossible to be sad when you’re riding on the jet-ski.