Results 1 to 5 of 5
- 10-07-2009, 07:30 AM #1
Member
- Join Date
- Oct 2009
- Posts
- 3
- Rep Power
- 0
How to call Oracle stored procedure from Java?
Hello All,
I want to call one stored procedure from Java. I have written following code. But its not able to make connection to server where Database is running.
Regards,Java Code:try { DriverManager.registerDriver (new oracle.jdbc.OracleDriver()); Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@192.168.100.148:1526:VIS1", "apps", "apps"); CallableStatement cstmt = null; cstmt = conn.prepareCall("Begin myproc(:1); End;"); cstmt.setString(1,dis.readLine()); cstmt.execute(); } catch (SQLException ex) { System.out.println("Failed to establish a connection to: "); } }
Parag
- 10-07-2009, 07:37 AM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 8
It would help if you actually posted what exception you got.
- 10-07-2009, 07:41 AM #3
Member
- Join Date
- Oct 2009
- Posts
- 3
- Rep Power
- 0
Its going in SQLException which I handles and showing
"Failed to establish a connection to:
Process exited with exit code 0."
- 10-07-2009, 07:43 AM #4
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 8
Yes, I know that from looking at the code. I want to know what exception you are getting. Add an ex.printStackTrace() to that catch block.
- 10-07-2009, 07:50 AM #5
Member
- Join Date
- Oct 2009
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
calling stored procedure through java
By KTR in forum JDBCReplies: 2Last Post: 01-30-2009, 12:53 PM -
[SOLVED] Java equivalent to X11 Work Procedure
By LongHitter in forum New To JavaReplies: 0Last Post: 01-12-2009, 11:36 AM -
stored procedure
By sankarigopi in forum JDBCReplies: 1Last Post: 11-13-2008, 04:53 PM -
How to get multiple rows from Stored Procedure
By SRJ1957 in forum Advanced JavaReplies: 0Last Post: 08-11-2008, 08:26 PM -
How can I call java class methods in Oracle 10g PL/SQL
By searcher34 in forum JDBCReplies: 0Last Post: 01-02-2008, 01:52 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks