Creating a database on a Blackberry phone

please help me I created a database on a Blackberry phone. I also created a table inside the database, but when I click on the database on the Blackberry simulator, it shows UNABLE TO DISPLAY file, and the code I wrote

class CreateDatabaseSchemaScreen extends MainScreen{ 
    Database d;
    public CreateDatabaseSchemaScreen(){            


         try
         {
             URI myURI = URI.create("file:///SDCard/Databases/SQLite_Guide/"    +                    "MyEncryptedDatabase.db");
              DatabaseSecurityOptions dbso = new DatabaseSecurityOptions(true);
              d = DatabaseFactory.create(myURI,dbso);
              d= DatabaseFactory.open(myURI);
              Statement s= d.createStatement("CREATE TABLE 'People' ( " +
                             "'Name' TEXT, " +
                             "'Age' INTEGER )" );
              s.prepare();
              s.execute();
              s.close();                    

              d.close();
          }
          catch ( Exception e )
          {
              System.out.println( e.getMessage() );
               e.printStackTrace();
          }
       } 
     }
+3
source share
1 answer

Database files cannot be opened directly; you will need a third-party desktop tool that allows you to manage it. Here you can find a list of these tools (as a rule, they are free): http://www.sqlite.org/cvstrac/wiki?p=ManagementTools

BB , , SDCard. , , , .

+1

All Articles