May 27, 2008

ORA-03115: Unsupported network datatype or representation

While duelling with Java sql and preparedstatement I got this error.

This was due to using the query both in initiating prepared statement and while executing it.
The solution is to omit the query parameter from executeQuery

Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:xe", "Birrah", "String sqlQuery = "SELECT x, y, z VIEWgup where dt > ?";
PreparedStatement ptmt = conn.prepareStatement(sqlQuery);
ptmt.setDate(1, new java.sql.Date(sonTarih.getMillis()));
ResultSet rset = ptmt.executeQuery (sqlQuery);
//this executequery statement above should be called woth no parameters.

1 comment:

  1. Thank you. Your blog posting just helped solve my problem.

    ReplyDelete