Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9014509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:31:38+00:00 2026-06-16T03:31:38+00:00

I am trying to import a database that I have stored on my SD

  • 0

I am trying to import a database that I have stored on my SD card that I used as a backup to replace the current database if I want to revert back to something but when I try to import I get a NonWritableChannelException

error

12-15 12:27:48.190: W/System.err(13599): java.nio.channels.NonWritableChannelException
12-15 12:27:48.190: W/System.err(13599):    at java.nio.FileChannelImpl.checkWritable(FileChannelImpl.java:85)
12-15 12:27:48.190: W/System.err(13599):    at java.nio.FileChannelImpl.transferTo(FileChannelImpl.java:399)
12-15 12:27:48.190: W/System.err(13599):    at com.tyczj.bowling.Bowlers$ImportData.importGames(Bowlers.java:944)
12-15 12:27:48.200: W/System.err(13599):    at com.tyczj.bowling.Bowlers$ImportData.doInBackground(Bowlers.java:914)
12-15 12:27:48.200: W/System.err(13599):    at com.tyczj.bowling.Bowlers$ImportData.doInBackground(Bowlers.java:1)
12-15 12:27:48.200: W/System.err(13599):    at android.os.AsyncTask$2.call(AsyncTask.java:287)
12-15 12:27:48.200: W/System.err(13599):    at java.util.concurrent.FutureTask.run(FutureTask.java:234)
12-15 12:27:48.210: W/System.err(13599):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
12-15 12:27:48.210: W/System.err(13599):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
12-15 12:27:48.210: W/System.err(13599):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
12-15 12:27:48.210: W/System.err(13599):    at java.lang.Thread.run(Thread.java:856)

here is the method I use to import

public boolean importGames(){
        File newDB = new File(Environment.getExternalStorageDirectory() + "/BCAData/Games");
        File oldDB = new File(Environment.getDataDirectory()+"/data/my.app.package/databases/Games");
        if(newDB.exists()){
            try {
                FileChannel fromChannel = new FileInputStream(newDB).getChannel();
                FileChannel toChannel = new FileInputStream(oldDB).getChannel();
                fromChannel.transferTo(0,fromChannel.size(),toChannel); //fails here
                try{
                    if(fromChannel != null){
                        fromChannel.close();
                    }
                }finally{
                    if(toChannel != null){
                        toChannel.close();
                    }
                }
                return true;
            } catch (Exception e) {
                e.printStackTrace();
            }

        }
        return false;
    }

What does this error mean, I have never had this one before and how can I import the database file properly

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:31:39+00:00Added an answer on June 16, 2026 at 3:31 am

    Your “to” channel should be a File Output Stream, since you want to write into (not read from) this file:

    FileChannel toChannel = new FileOutputStream(oldDB).getChannel();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to import data to an Oracle database. I have .imp and
I am trying to import data from a database that uses primary key /
I have a ton Visual FoxPro db files that I am trying to import
I have some CSV data files that I want to import into mySQL. I
I'm trying to read data stored in a ms access database that generated by
I am trying to import data from a large database. I have two tables
I have a table that contains data that I am trying to import into
I am trying to import a wordpress database to other server, but that server
I'm trying to import a text file into a MySQL database, and I'm having
I am trying to import data from excel file (.xlsx) into sql database, my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.