User Profile

Collapse

Profile Sidebar

Collapse
MauBady
MauBady
Last Activity: Apr 10 '07, 01:54 PM
Joined: Mar 28 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • MauBady
    replied to empty resultset
    in Java
    Thank you
    Yes, the problem seem to be this.

    i have commented also the line related to the closure of the Statement and now it seem correct.


    Code:
      public ResultSet EseguiLettura(String sSqlToExecute) throws SQLException
      {
          Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
          ResultSet rs = stmt.executeQuery(sSqlToExecute);
    ...
    See more | Go to post

    Leave a comment:


  • MauBady
    replied to empty resultset
    in Java
    this is the error

    Exception in thread "main" java.lang.NullP ointerException
    at oracle.jdbc.dri ver.UpdatableRe sultSet.next(Up datableResultSe t.java:251)
    at EseguiProcesso. main(EseguiProc esso.java:72)


    and this is the line:
    Code:
            
    while (rs.next())
            {
              System.out.println("nullo");
            }
    See more | Go to post

    Leave a comment:


  • MauBady
    replied to empty resultset
    in Java
    Thanks

    This is the code


    Code:
    import java.util.*;
    import java.sql.*;
    public class EseguiProcesso 
    {
      private static String msgInfo="Inizio EseguiProcesso.";
      private static String strSql=null;
      
     public static void main(String args[]) throws OwnException
        {
          Configurazione config;
          DbConn dbConn;
    ...
    See more | Go to post

    Leave a comment:


  • MauBady
    replied to empty resultset
    in Java
    this is the code:

    ResultSet rs = dbConn.EseguiLe ttura(strSql);
    dbConn.closeCon n();
    while (rs.next())
    {
    System.out.prin tln("not empty");
    }

    and the method call is

    public ResultSet EseguiLettura(S tring sSqlToExecute) throws SQLException
    {
    Statement stmt = conn.createStat ement(ResultSet .TYPE_SCROLL_IN SENSITIVE,...
    See more | Go to post

    Leave a comment:


  • MauBady
    replied to empty resultset
    in Java
    Thanks
    but if i try to iterate i obtain the java.lang.NullP ointerException . It is possible test the resutset if empty or no without throw the exception?
    See more | Go to post

    Leave a comment:


  • MauBady
    started a topic empty resultset
    in Java

    empty resultset

    Hello,
    I'm new in java. my actual problem is :
    how can i test if a resultset is empty?

    I have tested:

    rs == null
    rs.next()
    rs.isAfterLast( )
    rs.last()

    but the result is the exception java.lang.NullP ointerException
    See more | Go to post
No activity results to display
Show More
Working...