Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
Posts: 5
Registered: ‎10-11-2012
My Device: Bold 9900
My Carrier: Mobistar

Open Database in "file:///store/home/user/MyApp/db.sqlite"

As the title said I want to open a database at this path : "file:///store/home/user/MySodexo/com.mysodexo.db.sqlite"

 


        FileConnection fconn = (FileConnection) Connector.open("file:///store/home/user/MySodexo/com.mysodexo.db.sqlite", Connector.READ_WRITE);
        
        if (!fconn.exists() || !fconn.canRead() || !fconn.canWrite() || fconn.isDirectory() || fconn.isHidden()) {
            throw new Exception("db not found");
        }

try {
                System.out.println(fconn.getURL());
                dataBase = DatabaseFactory.open(URI.create(fconn.getURL()));
                break;
            } catch(Exception e) {
                throw e;
            }


        fconn.close();