how to update databse in remote machine,i am having .sql file which i have to update my database schema in remote machine,client will provide me his machine ip address,database username,database password,database instance name...pls help me pls

package com.prion.testConnectivity;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import com.prion.testConnectivity.ScriptRunner;;
//import com.ibatis.common.jdbc.ScriptRunner;;

public class DataBaseScript {
     * @param args
     *            the command line arguments
    public static void main(String[] args) throws ClassNotFoundException,
        SQLException {

        String aSQLScriptFilePath ="C:\\export.sql";

        // Create MySql Connection
        String serverName = ""; // Use this server.
        String portNumber = "1521";
        String sid = "tpc";
        String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid; // for Oracle
        String username = "p6admin"; 
        String password = "system"; 

        Connection connection = DriverManager.getConnection(url, username, password);
         System.out.println("Database is connected");
        Statement stmt = null;

        try {
            // Initialize object for ScripRunner

            ScriptRunner sr = new ScriptRunner(connection, false, false);

            // Give the input file to Reader
            Reader reader = new BufferedReader(
                               new FileReader(aSQLScriptFilePath));

            // Exctute script

        } catch (Exception e) {
            System.err.println("Failed to Execute" + aSQLScriptFilePath
                    + " The error is " + e.getMessage());

problem : this code is working fine and updated all the tables but not packages(packages contains "SELECT" Statement" pls help me out


Re: update .sql file in client machine 80 80

i had tryied using batch file

sqlplus -S username/password@ @C:\export.sql
ECHO script run successfully!!

Note: This script is working and updating all the tables and packages but the problem here is in local machine oracle is not installed then it will not work pls help me out

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.