Quantcast
Channel: SCN : Popular Discussions - SAP SQL Anywhere
Viewing all articles
Browse latest Browse all 1302

UltraLiteJ Error[-121]: Permission denied: set read-only

$
0
0

Hi,

 

 

I am new to SAP Anywhere and I am working with UltraLite.

 

 

I used "UltraLiteJ16.jar" for J2se (\SQL Anywhere 16\UltraLite\UltraLiteJ\J2se\UltraLiteJ16.jar) in my code.

 

 

I changed the example given in the below link (Example: Managing database operations on an Android smartphone) to work with j2se instead of Android.

 

http://dcx.sap.com/index.html#sa160/en/ulj/ulj-dbmanagement-android-sample.html

 

 

The changes I made:

instead of "DatabaseManager.createConfigurationFileAndroid ()" method I used "DatabaseManager.createConfigurationFile ()"

 

 

public void createDb(String strFilename) throws ULjException {

 

      ConfigFile config = DatabaseManager.createConfigurationFile(strFilename);

      try {

            conn = DatabaseManager.connect(config);

      } catch (ULjException ex) {

            conn = DatabaseManager.createDatabase(config);

            System.err.println("Successfully created a new database");

    

              for(int i = 0; i< stmt.length; i++) {

                  ExecuteSQLStatement(stmt[i]);

              }

      }

 

  }

 

 

 

 

 

I have attached the java code also (since JAVA files are not allowed, i renamed UltralitejDemo.java to UltralitejDemo.txt).

 

 

When I ran the program, Creating table, Inserting and deleting data working fine but Update giving following error:

 

 

com.ianywhere.ultralitej16.implementation.JrException: UltraLiteJ Error[-121]: Permission denied: set read-only

  at com.ianywhere.ultralitej16.implementation.JrException.throwException(Unknown Source)

  at com.ianywhere.ultralitej16.implementation.JrException.throwException(Unknown Source)

  at com.ianywhere.ultralitej16.implementation.JrValue.checkReadOnly(Unknown Source)

  at com.ianywhere.ultralitej16.implementation.JrValue.setInternal(Unknown Source)

  at com.ianywhere.ultralitej16.implementation.JrRow.setValue(Unknown Source)

  at com.ianywhere.ultralitej16.implementation.PrepStmtChanger.copyValuesToRow(Unknown Source)

  at com.ianywhere.ultralitej16.implementation.PrepStmtUpdate.execute(Unknown Source)

  at sql.anywhere.ultralitej.demo.UltralitejDemo.UpdateDepartment(UltralitejDemo.java:123)

  at sql.anywhere.ultralitej.demo.UltralitejDemo.<init>(UltralitejDemo.java:44)

  at sql.anywhere.ultralitej.demo.UltralitejDemo.main(UltralitejDemo.java:198)

 

 

 

I need help/suggestions to solve this problem.

 

 

 

Thanks and Regards

Shashi


Viewing all articles
Browse latest Browse all 1302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>