Load Files for Effeiency
<p>I was told there is a way to clean up my code to make it run faster. i should be able to reuse variables so i wont have to keyed them over and over again.  Thus in return should make my reading of my files faster when load time comes, but i cant seem to figure out how to do this. My code works fine just not as effiecient.</p>

<pre><code>        InputStream in = myContext.getResources().openRawResource(R.raw.sql1);
        BufferedReader br = new BufferedReader(new InputStreamReader(in));
        String xmlFile = br.readLine();
        DocumentBuilder builder =           DocumentBuilderFactory.newInstance().newDocumentBuilder();

        Document doc = builder.parse(xmlFile);

        NodeList statements = doc.getElementsByTagName("statement");            

        for (int i=0; i&lt;statements.getLength(); i++) {
            s = statements.item(i).getChildNodes().item(0).getNodeValue();
            db.execSQL(s);
        }

        in.close();
        doc = null;
        statements = null;
        in = null;
        br.close();
        br = null;


        InputStream in2 = myContext.getResources().openRawResource(R.raw.sql2);
        BufferedReader br2 = new BufferedReader(new InputStreamReader(in2));
        String xmlFile2 = br2.readLine();
        Document doc2 = builder.parse(xmlFile2);

        NodeList statements2 = doc2.getElementsByTagName("statement");          

        for (int i=0; i&lt;statements2.getLength(); i++) {
            s = statements2.item(i).getChildNodes().item(0).getNodeValue();
            db.execSQL(s);
        }

        in2.close();
        doc2 = null;
        statements2 = null;
        in2 = null;
        br2.close();
        br2 = null;




        InputStream in3 = myContext.getResources().openRawResource(R.raw.sql3);
        BufferedReader br3 = new BufferedReader(new InputStreamReader(in3));
        String xmlFile3 = br3.readLine();

        Document doc3 = builder.parse(xmlFile3);

        NodeList statements3 = doc3.getElementsByTagName("statement");          
        for (int i=0; i&lt;statements3.getLength(); i++) {
            s = statements3.item(i).getChildNodes().item(0).getNodeValue();
            db.execSQL(s);
        }

        in3.close();
        doc3 = null;
        statements3 = null;
        in3 = null;
        br3.close();
        br3 = null;


        InputStream in4 = myContext.getResources().openRawResource(R.raw.sql4);
        BufferedReader br4 = new BufferedReader(new InputStreamReader(in4));
        String xmlFile4 = br4.readLine();
        Document doc4 = builder.parse(xmlFile4);
        NodeList statements4 = doc4.getElementsByTagName("statement");          
        for (int i=0; i&lt;statements4.getLength(); i++) {
            s = statements4.item(i).getChildNodes().item(0).getNodeValue();
            db.execSQL(s);
        }

        in4.close();
        doc4 = null;
        statements4 = null;
        in4 = null;
        br4.close();
        br4 = null;

        InputStream in5 = myContext.getResources().openRawResource(R.raw.sql5);
        BufferedReader br5 = new BufferedReader(new InputStreamReader(in5));
        String xmlFile5 = br5.readLine();
        Document doc5 = builder.parse(xmlFile5);
        NodeList statements5 = doc5.getElementsByTagName("statement");          
        for (int i=0; i&lt;statements5.getLength(); i++) {
            s = statements5.item(i).getChildNodes().item(0).getNodeValue();
            db.execSQL(s);
        }

        in5.close();
        doc5 = null;
        statements5 = null;
        in5 = null;
        br5.close();
        br5 = null;
</code></pre>
