Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 conversion to t-sql

Author  Topic 

zahid.sabreen
Starting Member

14 Posts

Posted - 2011-01-19 : 05:09:19
import java.sql.*;
import oracle.jdbc.driver.*;

public class GET_CP_JDBC
{
public static ResultSet get_cp_jdbc ( String code) throws SQLException, Exception{

DriverManager.registerDriver(new OracleDriver());

// Obtain default connection
Connection conn = new OracleDriver().defaultConnection();
// Create any subsequent statements as a REF CURSOR
((OracleConnection)conn).setCreateStatementAsRefCursor(true);

----------------------------------------------------------------------
CREATE OR REPLACE PROCEDURE "CPWTRUNK"."GET_CP_JDBC_2_ORACLE" (
cp_code in VARCHAR2, cp_cursor out SYS_REFCURSOR
)
IS LANGUAGE JAVA
NAME 'GET_CP_JDBC_2.get_cp_jdbc_2(java.lang.String, java.sql.ResultSet)';

----------------------------------------------------------------------
Please help to convert this to t sql. I am new to t-sql. having a lot of problem.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-01-19 : 07:14:21
SQL Server cannot import Java modules or code, but version 2005 and later can use .NET CLR routines.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-01-20 : 10:16:52
You already got the answer
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=155454

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

zahid.sabreen
Starting Member

14 Posts

Posted - 2011-01-22 : 13:12:42
Thanks Madhivanan
Go to Top of Page
   

- Advertisement -