As of Oracle version 11, iSQL*Plus is not support by Oracle. The old version cannot connect to the new database.
As of NJIT's upgrade to Oracle 11g2 in August 2011, iSQL*Plus is not available.
The following program demostrates a connection to the course database on prophet.njit.edu and executing the SQL statement "SELECT SYSDATE FROM DUAL"
getConnection("jdbc:oracle:thin:@prophet.njit.edu:1521:course",
"oracle_username","oracle_password")
/*
* This sample demonstrates the jdbc driver by printing the system date from dual
* after connectng to the course database on prophet.njit.edu.
*/
// You need to import the java.sql package to use JDBC
import java.sql.*;
class jdbcTest_course
{
public static void main (String args [])
throws SQLException
{
// Load the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
String url = "jdbc:oracle:thin:@prophet.njit.edu:1521:course";
try {
String url1 = System.getProperty("JDBC_URL");
if (url1 != null)
url = url1;
} catch (Exception e) {
// If there is any security exception, ignore it
// and use the default
}
// Connect to the database
Connection conn =
DriverManager.getConnection (url, "username", "password");
// Create a Statement
Statement stmt = conn.createStatement ();
// Select the SYSDATE column from the dual table
ResultSet rset = stmt.executeQuery ("select SYSDATE from dual");
// Print the result
while (rset.next ())
System.out.println (rset.getString (1));
// Close the RseultSet
rset.close();
// Close the Statement
stmt.close();
// Close the connection
conn.close();
}
}
You can find documentation for the perl DBI module by clicking here.
The following is the perl DBI connect statement to use to connect to the "course" database running on prophet.njit.edu.
$dbh = DBI->connect("dbi:Oracle:host=prophet;sid=course";port=1521", ’username/password’)
or die" Error connecting to
course"
The following program demostrates a connection to the project database
on prophet.njit.edu and executing the SQL statement "SELECT SYSDATE
FROM DUAL"
Note: Always use /usr/local/bin/perl, not perl. Using only perl means that the first such instance found in your PATH will be used; this is genenerally /bin/perl, for which the DBI.pm module is not available. /usr/local/bin/perl (version 5.8.0 as of Fall 2005) does contain the DBI.pm module
#!/usr/local/bin/perl -w
use strict;
use DBI;
my $dbh = DBI->connect("dbi:Oracle:host=prophet.njit.edu;sid=course;port=1521", ’username/password’)
or die" Error connecting to project";
my $sql = qq{ SELECT SYSDATE FROM DUAL };
my $sth = $dbh->prepare( $sql );
$sth->execute();
while (my($sysdateString) = $sth->fetchrow_array){
print $sysdateString, "\n";
}
$dbh->disconnect();
# See the DBI module documentation for full details
# for some advanced uses you may need Oracle type values:
#use DBD::Oracle qw(:ora_types);
To see which perl is first in your PATH: which perl