|
Make sure the result files are correct and clear!
|
createStatement
, form
, getTables
, input
, param
, ResultSet
, and system
(but not all the keywords used) may be given.
Even if the keywords are provided, you still need to know where and how to put them.
#!/usr/bin/bash CLASSPATH=.:/usr/lib/oracle/23/client64 CLASSPATH=$CLASSPATH:/usr/lib/oracle/23/client64/lib/ojdbc8.jar CLASSPATH=$CLASSPATH:/usr/lib/oracle/23/client64/lib/ottclasses.zip export CLASSPATH |
#!/usr/bin/perl print( "Content-type: text/html\n\n" ); use CGI; $query = new CGI; $var = $query->param( 'var' ); # or $var = $query->url_param( 'var' ); $var =~ s/^\s*(\S*)\s*$/$1/; $var =~ s/;|>|>>|<|\*|\?|\&|\|//g; $cmd = "/usr/bin/java -Djava.security.egd=file:/dev/./urandom "; system( $cmd ); |
// Import the following packages to use JDBC. import java.sql.*; import java.io.*; import oracle.jdbc.*; import oracle.jdbc.pool.OracleDataSource; public class ClassName { public static void main( String args[ ] ) throws SQLException { String user = "C##user_id"; String password = "password"; String database = "20.185.147.112:1521/xe"; // Open an OracleDataSource and get a connection. OracleDataSource ods = new OracleDataSource( ); ods.setURL ( "jdbc:oracle:thin:@" + database ); ods.setUser ( user ); ods.setPassword( password ); Connection conn = ods.getConnection( ); Statement stmt = conn.createStatement( ); |
⇒
SQL*Plus commands⇒
results⇒
SQL commands⇒
results⇒
SQL commands⇒
results⇒
JDBC (including HTML and Perl) programs/commands⇒
results
Recommendations
To prepare the exam: |