Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!

ram menon

Greenhorn
+ Follow
since Oct 24, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ram menon

Hi,
You can use the Oracle extentions of jdbc to achieve this.
ARRAY array = ((OracleResultSet)rs).getARRAY (1);
Using array.getArray(), you can populate an array and then use that.
Note that in the select statement you should select the varray.
Hope this helps,
Ram
In case you are using a thin driver, you should explicitly start the listener. It does not start a listener by itself.
On personal oracle 8, the command is "TNSLSNR80". You can run it from a dos prompt. It will leave an empty screen open, just minimize it. After that process is running, youcan connect with the JDBC/Thin Driver.
Regards
Ram
Every Oracle installation will have an SID. By default it is ORCL. But you can change this during installation.
You can use the OCI driver if you do not know the SID.
jdbc:oracle:oci8:@<database>
where <database> is either an entry in tnsnames.ora or a SQL*net
name-value pair.
Hope this helps,
Ram
Hi,
This program calls a PL/SQL stored procedure which has got an OUT paramater. As U can see it is very simple to call PL/SQL from java.
import java.sql.*;
class PLSQL
{
public static void main (String args [])
throws SQLException, ClassNotFoundException
{
// Load the driver
Class.forName ("oracle.jdbc.driver.OracleDriver");
// Connect to the database
// You can put a database name after the @ sign in the connection URL.
Connection conn =
DriverManager.getConnection ("jdbc racle ci8:@", "scott", "tiger");

// Call a procedure with an OUT parameter
{
CallableStatement procout = conn.prepareCall ("begin my_proc(?); end;");
procout.registerOutParameter (1, java.sql.Types.BIGINT);
procout.execute();
System.out.println ("Out argument is: " + procout.getLong(1));
}

// Close the connection
conn.close();
}
}

Hope this helps,
Ram