see murali there are few errors you commited
1) conn =
(OracleConnection)DriverManager.getConnection("jdbc:oracle:oci8:@celtics:cel
tics:1521:crm","scott", "tiger");
should be
conn =
DriverManager.getConnection("jdbc:oracle:oci8:@celtics:cel
tics:1521:crm","scott", "tiger");
where conn should be ref. of Connection interface.
2) pstmt.executeQuery(); should be pstmt.executeUpdate(); as you are
inserting values.
3)i think java.util.Dictionary map = conn.getTypeMap(); should be
java.util.map map = conn.getTypeMap();
keep mailing :-)
sudipta bhowmik
On Fri, 11 Aug 2000, B.V.Murali Krishna wrote:
> Hi All ....
>
> below ia the error I am getting...
>
>
> test1.java:0: The method java.util.Dictionary getTypeMap() declared in
> class ora
> cle.jdbc.driver.OracleConnection cannot override the method of the same
> signatur
> e declared in interface java.sql.Connection. They must have the same
> return typ
> e.
>
>
> Above is the error for the source code I am using which is below...
>
> import java.sql.*;
> import oracle.jdbc.driver.*;
> import oracle.sql.*;
> import java.util.Dictionary;
>
>
> public class test1 {
>
>
>
> public static void main (String args[]) {
>
> OracleConnection conn = null;
> Statement stmt = null;
>
> int empno = 22;
> String add1 = "addfvkuhkre";
> String add2 = "abfgbddfvkuhkre";
> try {
> System.out.println("In main");
> DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver ());
> conn =
> (OracleConnection)DriverManager.getConnection("jdbc:oracle:oci8:@celtics:cel
> tics:1521:crm","scott", "tiger");
>
> java.util.Dictionary map = conn.getTypeMap();
> map.put("ADDRESS", Class.forName("helperAdd"));
> stmt = conn.createStatement ();
>
> helperAdd helper = null;
>
> PreparedStatement pstmt
> = conn.prepareStatement ("insert into emp1 values (?, ?)");
>
> helper = new helperAdd(add1, add2);
>
> pstmt.setInt(1, empno);
> pstmt.setObject(2, helper, OracleTypes.STRUCT);
> pstmt.executeQuery();
> System.out.println("insert done");
> pstmt.close();
> }
> //catch(Exception crtEx){ throw new Exception("crtEx");}
> catch(ClassNotFoundException e)
> {
> System.out.println(e);
> }
>
> catch(SQLException e)
> {
> System.out.println(e);
> }
> catch(Exception e)
> {
> System.out.println(e);
> }
> finally
> {
> try{
> if (conn != null) conn.close();
> }
> catch(Exception e)
> {
> System.out.println(e);
> }
>
> }
> }
>
> }
>
>
> helper ...
>
> public class helperAdd implements java.io.Serializable {
>
> public String add1;
> public String add2;
>
> public helperAdd() { }
>
> public helperAdd(
> String add1,
> String add2 ) {
> this.add1 = add1;
> this.add2 = add2;
> }
> }
>
>
>
> Thanks in Advance
>
>
> MURALI KRISHNA BALUSA
> VELOCIENT TECHNOLOGIES
> NEW DELHI.
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".