Distributed Real-Time

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Not able to do rs.next() in connection poolong program in weblogic 8.1

    0 answers - 1579 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    import java.util.Hashtable;

    import javax.naming.NamingException;

    import javax.naming.Context;

    import javax.naming.InitialContext;

    import javax.sql.DataSource;

    import java.sql.*;

    class TestConnection

    {

    public static void main(String[] args)throws Exception

    {

    Hashtable ht=new Hashtable();

    System.out.println("hastable created");

    ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");

    ht.put(Context.PROVIDER_URL,"t3://localhost:7001");

    System.out.println("property have been putted");

    Context ctxt=new InitialContext(ht);

    System.out.println("before datasource");

    DataSource ds=(DataSource)ctxt.lookup("ushaPool");

    System.out.println("datasource"+ds);

    System.out.println("before connection");

    Connection con=(Connection)ds.getConnection();

    System.out.println("connection"+con);

    Statement stmt=con.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_UPDATABLE);

    System.out.println("after connection "+stmt);

    ResultSet rs=(ResultSet)stmt.executeQuery("select * from users");

    System.out.println("");

    System.out.println("got resultset"+rs);

    while(rs.next())

    {

    }

    //System.out.println("flag value is-"+flag);

    stmt.close();

    rs.close();

    }

    }

    When i am doing this with weblogic 8.1 ,at the command prompt when the program runs i am gett in the error

    java.sql.SQLException:Invalid operation for readonly resultset:moveToCurrentRow

Re: Not able to do rs.next() in connection poolong program in weblogic 8.1


max 4000 letters.
Your nickname that display:
In order to stop the spam: 2 + 2 =
QUESTION ON "Distributed Real-Time"

JAVA TECH