JDBC RowSet

Hi,
After calling moveToInsertRow(), for some reason if I do not insert a record. Do I have to call some other method set the cursor back ?
Is there any method to do that ... because I am getting exception
Invalid operation for the current cursor position
Thanks in advance.

Hi,
After calling moveToInsertRow(), for some reason if I do not insert a record. Do I have to call some other method set the cursor back ?
Is there any method to do that ... because I am getting exception
Invalid operation for the current cursor position
Thanks in advance.

Similar Messages

  • Sun ONE Studio 5 evaluation. JDBC RowSet question.

    I am accessing a MYSQL database using form wizard. I am also using the DataNavaigator. When I use RowSet type: NB CachedRowSet, I can bring in and scroll through existing data, add, change, and delete rows with no problem. When I use NB JDBC RowSet, I can not do any of these things. I do not receive an error, it just not work. It is my understanding that for larger rowsets, I should be using the JDBC RowSet. Also, when calling in a large row set, how do you get to an item without scrolling to it using the DataNavagator. Thank you in adavance for your time.

    In the Sun One the is a ServerAdministrative menu by clicking on it u get a window to look that deployed application... check out the server cluster.. load balancing and stuffs like that in the same window there is a Database icon where u have to set the driver path and give the drive name.. with the max connection min connection that would solve your problem

  • Package sun.jdbc.rowset does not exist

    Hi,
    I am tryng to use a CachedRowSet in a JSP page. I got rowset.jar from sun and I put it in my classpath. When I try to import sun.jdbc.rowset I have the message "package sun.jdbc.rowset does not exist".
    Please, could someone help me?
    Tanks,
    Celso

    Hi,
    Unfortunately not... The name of the package is rowset...
    Some others ideas? Thanks,
    Celso

  • How to use JDBC RowSet ?

    Dear all,
    I downloaded Jdbc Rowset and configured it in my PC. But when I use CathedRowSet,it give me the following errors.
    Exception in thread "main" java.lang.UnsupportedClassVersionError: javax/sql/Row
    Set (Unsupported major.minor version 48.0)....
    I am using JDK1.4.
    Does anybodu give me an idea ?
    Thank you.
    Kevin

    Have a look at your other thread I posted an answer there.
    These classes were probably compiled with jdk 1.3 so won't work with 1.4. You need to uninstall 1.4 and reinstall with 1.3 to use these classes.
    (the other thread is http://forum.java.sun.com/thread.jsp?forum=4&thread=292105)

  • JDBC RowSet DML Sample

    Hello,
    Excuses for school English + google,
    With javac : error: AirlinesDML.java:42: unreported exception java.sql.SQLException; must be caught or declared to be thrown private static RowSet rowset = new OracleJDBCRowSet();
    With Java version "1.5.0_06".
    I am deroute because the throws SQLException east declares in the code!
    If a person can m help that would be sympathetic nerve.
    Thank,
    Claude

    Sorry, the source :
    package oracle.otnsamples.jdbc;
    import javax.sql.RowSet;
    import oracle.jdbc.rowset.OracleJDBCRowSet;
    import java.util.ArrayList;
    import java.util.List;
    import java.io.IOException;
    import java.sql.SQLException;
    public class AirlinesDML {
    private static RowSet rowset = new OracleJDBCRowSet(); // ERROR
    protected RowSetCache rowSetCache;
    public AirlinesDML() {
    public List selectRecords(String code,String name, String partner)
    throws SQLException, IOException{
    String query = null;
    ArrayList data = new ArrayList( );
    try {      
    code = "%"+code+"%";
    name = "%"+name+"%";
    partner = "%"+partner+"%";
    query = "SELECT * FROM otn_airlines " +
    "WHERE UPPER(code) LIKE UPPER('"+code+"') AND " +
    "UPPER(name) LIKE UPPER('"+name+"') AND " +
    "UPPER(partner) LIKE UPPER('"+partner+"') ORDER BY code";
    rowset = RowSetCache.getInstance().getRowSet();
    rowset.setCommand (query);
    rowset.execute ();
    while (rowset.next ()) {        
    String[] row = new String[3];
    for ( int i = 0; i < 3; i++ ) {
    row[ i ] = rowset.getString( i + 1 );
    data.add(row);
    } finally {      
    rowset.close();
    return data;
    public void insertRecord( String code,String name,String partner )
    throws SQLException, IOException{
    String query = null;
    try {     
    query = "INSERT INTO otn_airlines VALUES ('"+code+"','"+name+"','"+
    partner+"')";
    rowset = RowSetCache.getInstance().getRowSet();
    rowset.setCommand (query);
    rowset.execute();
    } finally {      
    rowset.close();
    public void updateRecord(String code, String name, String partner)
    throws SQLException, IOException{
    String query = null;
    try {    
    query = "SELECT * FROM otn_airlines " +
    "WHERE UPPER(code) LIKE UPPER('"+code+"')";
    rowset = RowSetCache.getInstance().getRowSet();
    rowset.setCommand(query);
    rowset.execute();
    query = "UPDATE otn_airlines SET name ='"+name+"', partner ='"
    partner"' WHERE code ='"+code+"'";
    rowset.setCommand(query);
    rowset.execute();
    } finally {  
    rowset.close();
    public void deleteRecord(String code) throws SQLException, IOException{
    String query = null;
    try {   
    query = "DELETE FROM otn_airlines WHERE code='"+code+"'";
    rowset = RowSetCache.getInstance().getRowSet();
    rowset.setCommand(query);
    rowset.execute();
    } finally {      
    rowset.close();
    public boolean checkTables() throws SQLException, IOException, Exception{
    try {        
    rowset = RowSetCache.getInstance().getRowSet();
    rowset.setCommand (" SELECT table_name FROM user_tables "+
    " WHERE table_name = 'OTN_AIRLINES' ");
    rowset.execute ();
    if (!rowset.next ()) {       
    this.createSchemaTables();
    } finally {    
    rowset.close();
    return true;
    public void createSchemaTables() throws SQLException, IOException, Exception {
    this.createTable();
    this.insertRecord("2R", "2R Airways", "N");
    this.insertRecord("2S", "2S Airways", "N");
    this.insertRecord("3C", "3C Airways", "N");
    this.insertRecord("3M", "3M Airways", "N");
    this.insertRecord("4S", "4S Airways", "N");
    this.insertRecord("5A", "5A Airways", "N");
    this.insertRecord("7F", "7F Airways", "N");
    this.insertRecord("A3", "A3 Airways", "N");
    this.insertRecord("AA", "AA Airways", "N");
    this.insertRecord("AC", "AC Airways", "N");
    this.insertRecord("AD", "AD Airways", "N");
    this.insertRecord("6E", "6E Airways", "N");
    public void createTable() throws SQLException, IOException{
    try {    
    rowset = RowSetCache.getInstance().getRowSet();
    String query = "CREATE TABLE otn_airlines(code VARCHAR2(2) NOT NULL " +
    "PRIMARY KEY, name VARCHAR2(40) NOT NULL, "+
    "partner VARCHAR2(1) NOT NULL)";
    rowset.setCommand(query);
    rowset.execute();
    } finally {     
    rowset.close();
    }

  • Problem with sun.jdbc.rowset.CachedRowSet.

    Hi All,
    I cannot not able to import the package 'sun.jdbc.rowset.CachedRowSet'.
    while writing the path in the jsp:useBean or import to java class it shows at the compilation time that
    Error JavaCompile: sun.jdbc.rowset cannot be resolved.
    Is there any jar file needed and if then where i can find it.
    actually i need to import this for implementing the large row in paging system in jsp page.
    Thanks in advance.
    Regards
    ukbasak

    hi,
    Another link which to point over the rowset.jar file
    http://forums.systeminetwork.com/isnetforums/archive/index.php?t-36523.html

  • Exporting table data from a JDBC rowset to an excel sheet

    Hi,
        I am developing an application in which I have to insert and display records on a view.
        I have used a webservice to display data.
        On the display view I need to provide a button which on clicking exports the table data to an excel sheet.
       I want to use the JDBC rowset to export data to an excel rather than the binary cache method.
       So could someone plz help me out with the code.

    Dear Abinas,
    Please read this tutorial.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/edc2f3c2-0401-0010-8898-acd5b6a94353?QuickLink=index&…
    Thanks & Regards,
    Patralekha

  • Sun.jdbc.rowset where go i get it n in which JDK version

    i saw some code in this forum regarding pagination where sun.jdbc.rowset is being imported..please help me . i get an error saying that sun.jdbc.rowset not found i am using jdk1.4.

    thanks i got the link from the forum
    You can find it at http://java.sun.com/developer/earlyAccess/jdbc/jdbc-rowset.html

  • Sun.jdbc.rowset

    Hi,
    Any one please tell me where i can get sun.jdbc.rowset package.
    please give me specific URL to download the rowset.jar file
    Thanking you,
    Shajahan

    Hello,
    It's probably this one:
    http://java.sun.com/developer/earlyAccess/jdbc/jdbc-rowset.html
    It may also be available in the jdk1.5.

  • JDBC-ROWSET SUPPORT ORACLE

    DID ANY OF THE ORACLE THIN DRIVER SUPPORTS JAVA-ROWSETS. IF SO FROM WHERE I CAN DOWNLOAD THE DRIVER. I TRYED ROWSETS WITH 8.1.7 ORACLE THIN DRIVER, I COULD NOT IMPLEMENT IT.

    Hi I am using latest driver from oracle site, but the problem is when i fire execute method of cahed rowset i throws error that i mentioned above, if you have any other driver than mail me on [email protected]

  • Create Resultset/Rowset programatically

    How can I create a resultset/rowset programatically from scratch, without connecting to database. Actually I'm designing an N-tier intranet app. The page controller (JSP) has to pass the data of the HTTP request to the buiness tier in a generic form. As our business tier is using resultset for its methods (for efficiency and simplicity we avoided using a pure object oriented business tier whose objects have the state as their fields. Instead we have resultsets of the whole query that has the data of a single business transaction).
    Is it possible to create rowset without database connection? How?

    You can do it using CachedRowSet:
    import java.sql.*;
    import javax.sql.*;
    import sun.jdbc.rowset.*;
    public class RowSetExample
    public static void main(String args[])
    try {
    // create a new rowset and populate it...
    sun.jdbc.rowset.CachedRowSet crs = new sun.jdbc.rowset.CachedRowSet();
    sun.jdbc.rowset.RowSetMetaDataImpl rsmdi = new sun.jdbc.rowset.RowSetMetaDataImpl();
    int colCount = 2;
    rsmdi.setColumnCount(colCount);
    rsmdi.setColumnDisplaySize(1, 5);
    rsmdi.setColumnName(1, "ID");
    rsmdi.setColumnType(1, java.sql.Types.INTEGER);
    rsmdi.setColumnTypeName(1, "INTEGER");
    rsmdi.setTableName(1, "MY_TABLE");
    rsmdi.setAutoIncrement(1, false);
    rsmdi.setSearchable(1, true);
    rsmdi.setColumnDisplaySize(2, 20);
    rsmdi.setColumnName(2, "NAME");
    rsmdi.setColumnType(2, java.sql.Types.VARCHAR);
    rsmdi.setColumnTypeName(1, "VARCHAR");
    rsmdi.setTableName(2, "MY_TABLE");
    rsmdi.setAutoIncrement(2, false);
    rsmdi.setSearchable(2, true);
    crs.setMetaData(rsmdi);
    java.util.Map map = new java.util.HashMap();
    map.put(new Integer(1), "AAA");
    map.put(new Integer(2), "BBB");
    map.put(new Integer(3), "CCC");
    java.util.Iterator iter = map.entrySet().iterator();
    while (iter.hasNext()){
    java.util.Map.Entry entry = (java.util.Map.Entry) iter.next();
    int idx = 0;
    crs.moveToInsertRow();
    crs.updateObject(1, entry.getKey());
    crs.updateObject(2, entry.getValue());
    crs.insertRow();
    crs.moveToCurrentRow();
    crs.beforeFirst();
    while (crs.next()){
    System.out.print(crs.getObject(1));
    System.out.println(": " + crs.getObject(2));
    }catch (SQLException ex) {
    System.err.println("SQLException: " + ex.getMessage());
    }

  • [Oracle JDBC Driver]Invalid parameter binding(s).

    Hi there
    I am using the OracleCachedRowSet, and it works fine until I tries to update a resultset with a null value. When I call rs.acceptChanges(connection); it results in the following exception.
    Please help if anyone has found a workaround to this problem.
    java.sql.SQLException: [BEA][Oracle JDBC Driver]Invalid parameter binding(s).
    at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
    at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
    at weblogic.jdbc.base.BaseParameters.getParameter(Unknown Source)
    at weblogic.jdbc.base.BasePreparedStatement.setObjectInternal(Unknown Source)
    at weblogic.jdbc.base.BasePreparedStatement.setObject(Unknown Source)
    at weblogic.jdbc.wrapper.PreparedStatement.setObject(PreparedStatement.java:268)
    at oracle.jdbc.rowset.OracleCachedRowSetWriter.updateRow(OracleCachedRowSetWriter.java:429)
    at oracle.jdbc.rowset.OracleCachedRowSetWriter.writeData(OracleCachedRowSetWriter.java:534)
    at oracle.jdbc.rowset.OracleCachedRowSet.acceptChanges(OracleCachedRowSet.java:2926)
    at eurostat.Items.updateRS(Items.java:192)
    at eurostat.DBConnectionBean.updateRS(DBConnectionBean.java:94)
    at jsp_servlet.__mainpage._jspService(MainPage.jsp:248)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at com.bea.wlw.netui.pageflow.PageFlowJspFilter.doFilter(PageFlowJspFilter.java:246)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6724)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

    Hi Avi
    Thanks for the suggestion, but I don't thint that is the problem. In other forums I have found people describing the same problem(both with Oracle and Sun's implementation of CachedRowSet). See this link for an example http://bugs.mysql.com/bug.php?id=9831. So I figured that those other people needed to have a solution to the problem, but I can't find it.
    /Thomas

  • Still problems with RowSet Sun implementation

    In a topic I previoulsy posted I shown my inability to make JoinRS work:
    http://forum.java.sun.com/thread.jsp?thread=523969&forum=48&message=2540269
    I was told the new realease, due to be out sometime in June, would have included corrections for my problem.
    Do you have any info about the new realease of Rowset RI by Sun?
    I downloaded JDBC RowSet Implementations 1.0 JWSDP 1.4 Co-Bundle, hoping that would be it, but the RI included in it is still 1.0 (though the jar lib files have different size)
    Please help me with any info you can provide. My university thesis would greatly benefit from it.
    Thank you in advance.

    Yes Neo, sometime in the next two weeks, we will release it.
    There is some formalities to be done as soon as they are done we will be out.
    Please saty tuned. :)

  • Using RowSet with MS Access

    sun.jdbc.rowset.JdbcRowSet doesn't work with MS Access ?
    It raises java.sql.SQLException: Invalid Cursor Type: 1003, 0, null
    sun.jdbc.rowset.CachedRowSet doesn't work either:
    How can I use JdbcRowSet or CachedRowSet with MS Access ?
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    // initialize our RowSet
    JdbcRowSet titleRs = new JdbcRowSet();
    titleRs.setUrl("jdbc:odbc:Test-Adressen"); // example DSN
    titleRs.setCommand("SELECT id, title from Titles");
    titleRs.execute();
    //next line throws Exception :
    titleRs.moveToInsertRow();//move to construct an insert row
    titleRs.updateString(2, "Dipl.-Ing.");// initialize phone
    titleRs.insertRow(); // insert the row
    titleRs.moveToCurrentRow(); // move back to
    // previous cursor position
    titleRs.next();
    catch (SQLException se) {
    System.out.println( se+", "+se.getErrorCode()+", "+se.getSQLState());
    se.printStackTrace();
    catch (Throwable t) {
    System.out.println( t);
    t.printStackTrace();
    Output:
    java.sql.SQLException: Invalid Cursor Type: 1003, 0, null
    JdbcRowSet (setTypeMap): null
    JdbcRowSet (setMaxFieldSize): [Microsoft][ODBC Microsoft Access Driver]Optionales Feature wurde nicht implementiert.
    JdbcRowSet (setQueryTimeout): [Microsoft][ODBC Microsoft Access Driver]Optionales Feature wurde nicht implementiert.
    java.sql.SQLException: Invalid Cursor Type: 1003
    at sun.jdbc.odbc.JdbcOdbcResultSet.moveToInsertRow(JdbcOdbcResultSet.java:4143)
    at sun.jdbc.rowset.JdbcRowSet.moveToInsertRow(JdbcRowSet.java:2658)
    at de.CoSoCo.relations.Title.main(Title.java:72)
    note on error message : using german version of MS Access
    please answer also to [email protected]

    Hi Ulf,
    also der Fehler kommt mir irgendwie bekannt vor. :) Ich muss mal schauen, wie ich den umschifft habe. Aber es liegt wohl eben auch an Access das Cursor Manipulation nicht geht. Wenn ich den Sourcecode gefunden habe mail ich ihn Dir.
    Cu
    Olaf

  • Question about Rowset and CachedRowSet

    Hi all,
    I'd like to use CachedRowSet in my BMP EJB.
    So I downloaded the RowSet Api early access but
    I discovered that the interface sun.jdbc.rowset.RowSet
    isn't in the jar file....so I took a look in weblogic.jar
    there exists javax.sql.RowSet but then it doesn't exist
    the class CachedRowSet...!!!
    What should I do in order to use both the interface and the class???
    Thanks a lot
    Francesco

    Hi Francesco,
    Are you talking about the Sun CachedRowSet early access? In my
    experience you need 2 jar files for this: rowset.jar has
    sun.jdbc.rowset.CachedRowSet and related classes, then you also need to
    get jdbc2_0-stdext.jar which has javax.sql.RowSet and related classes.
    Hope this helps,
    -- Mitch
    Francesco wrote:
    Hi all,
    I'd like to use CachedRowSet in my BMP EJB.
    So I downloaded the RowSet Api early access but
    I discovered that the interface sun.jdbc.rowset.RowSet
    isn't in the jar file....so I took a look in weblogic.jar
    there exists javax.sql.RowSet but then it doesn't exist
    the class CachedRowSet...!!!
    What should I do in order to use both the interface and the class???
    Thanks a lot
    Francesco

Maybe you are looking for

  • Problem with my MSI 290x gaming 4g performance in unigine valley benchmark.

    First im dutch(netherlands) so sorry for my maybe bad english. My system is: Asus p8z77 v deluxe mb intel 3770k cpu 16gb ram 1866 Corsair 2x ssd 256 gb OCZ MSI 290x gaming win7 64bit ultimate. When i came home with my card i removed my old 7970 and r

  • Re: not exists SQL using ! filter expression with a variable

    This is still not producing the correct result set in Kodo JDO 3.0.0RC4. I see the following SQL statement in the log. DEBUG ExecuteThread: '10' for queue: 'default' kodo.jdbc.SQL - <t 7720801, conn 5232795> [10 ms] executing prepstmnt 1654874 SELECT

  • How do I use an image in my application?

    can anyone show me a simple code? how to use image in blackberry?

  • Airdrop for Notes Not Available

    I am trying to send a note via Notes by Airdrop from my Macbook Pro Retina mid-2014 to an iPhone 5. I can see all the different options but Airdrop. I click on More and get the Extensions System Preference panel and the Share Menu. Airdrop is checked

  • Fax mobile phone

    hi, is it possible to upgrade nokia e71 to send fax from itself? thank you!