• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5623
  • Last Modified:

JDBC:ORA-03115: unsupported network datatype or representation

Hi,

I am using a simple jdbc program to retireve the primary key from the database. but I am getting the error ORA-03115: unsupported network datatype or representation .
The relevant code is:

javax.naming.Context initialContext = new javax.naming.InitialContext();
                  DataSource ds = (DataSource)initialContext.lookup("RoCDS");
                  Connection con = ds.getConnection();
                  System.out.println("email recvd in dao: ***"+email);
                  System.out.println("password recvd in dao: ***"+password);
                  // End of code from salvi
                  //String userpkStr = null;
                  int userpk = 0;
                  long longuserPK = 0L;
                  //Integer userpkInt = null;
                  try
                  {
                        String q = "SELECT party_id FROM party WHERE user_name = ? AND password = ? ";
                                    
                                    //+ " FROM party WHERE user_name = " + email + " AND password = " + password ;
                        PreparedStatement s = con.prepareStatement(q);
                        try
                        {
                              s.setString(1, email);
                              s.setString(1, password);
                              System.out.println("Beofre querying ***");
                              ResultSet rs = s.executeQuery(q);
                              System.out.println("After querying ***");
                              try
                              {
                                    if (rs.next())
                                    {
                                          longuserPK = rs.getLong(1);
                                          System.out.println("PK retireved ***"+longuserPK);

                                          // Must remove this later on when we change PK from int to long
                            //userpkInt = new Integer(userpkStr);
                                          userpk = (int)longuserPK; //userpkInt.intValue();
                                          
                                    }
                                    else
                                    {
                                          throw new NoSuchObjectException("No such user: " + email);
                                    }
                                    return userpk;
                              } finally { rs.close(); }
                        } finally { s.close(); }
                  } finally { con.close(); }

The application server being used is weblogic 8.1, the Oracle dataase version beinfg ued is 9.2.
The dbURL and driver details are as set in the weblogic console are:

URL: jdbc:oracle:thin:@192.168.1.38:1521:roc
Driver class name: oracle.jdbc.xa.client.OracleXADataSource

This is a very urgent problem, pls post ur comments.

Best Regards

0
M_SYED
Asked:
M_SYED
  • 2
  • 2
1 Solution
 
NopiusCommented:
Try to add ';' at the end of SELECT:

String q = "SELECT party_id FROM party WHERE user_name = ? AND password = ? ;";
0
 
M_SYEDAuthor Commented:
Hi,

Nopius: I tried your suggestionbut it didnt help.
I am not trying to access any blob datatype here, the datatype of the attribute I am trying to access is Number(38).

My db is Oracle 9.2.07

Please help.............
0
 
M_SYEDAuthor Commented:
Hi,

I have solved it.

The problem line was:
ResultSet rs = s.executeQuery(q);

Solved it by replacing it with
ResultSet rs = s.executeQuery();

Thanks for responding.

I am gona award you the points for responding....... :- )

Best Regards


0
 
NopiusCommented:
Thank you, sometimes the prombem becomes easier for yourself when you ask someone :-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now