-
Junior Member
Connectivity in java with oracle
how we connect database using oracle 9i with java ?
-
Junior Member
Re: Connectivity in java with oracle
THIS IS THE JDBC PROGRAME
import java.sql.*;
import javax.sql.*;
import java.io.*;
public class CSDemo
{
public static void main(String ar[])
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch(ClassNotFoundException e)
{
System.out.println(e);
}
try
{
Connection
c=DriverManager.getConnection("jdbcrcle:thin:@localhost:1521:gdn","scott","tiger");
CallableStatement cs=c.prepareCall(" { call pr_nk1 } " );
cs.registerOutParameter(1,Types.VARCHAR);
cs.execute();
String stvalue=null;
stvalue=cs.getString(1);
System.out.println(stvalue);
cs.close();
c.close();
}
catch(SQLExceptin e)
{
System.out.println(e);
}
}
}
BYE,
NIRMAL KUMAR
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules