Link to home
Start Free TrialLog in
Avatar of desiboy1974
desiboy1974

asked on

noclassdef found error

can someone tell me what i'm doing wrong here..thanks..

i keep getting this error
Exception in thread "main" java.lang.NoSuchMethodError: main


import oracle.jdbc.driver.OracleDriver;
import java.sql.*;
import java.util.*;
import java.io.*;
import java.net.URL;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.MultipartPostMethod;
import org.apache.commons.logging.*;
import org.apache.commons.codec.*;


public class uploadVoip
{

  public uploadVoip() throws SQLException {

 generateFile();

 String targetURL = "http://signup.callplus.co/Upload.aspx";

 File targetFile = new File("/data/usr/swiftel/peoplevoip.CSV");

MultipartPostMethod filePost =
                        new MultipartPostMethod(targetURL);

                    try {
                                    filePost.addParameter("fileProvisioningData", targetFile);
                                    filePost.addParameter(targetFile.getName(), targetFile);
                        HttpClient client = new HttpClient();
                        client.setConnectionTimeout(5000);
                        int status = client.executeMethod(filePost);
                        if (status == HttpStatus.SC_OK) {
                           System.out.println(filePost.getResponseBodyAsString());
                        } else {
                            System.out.println( "ss1" );
                        }
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    } finally {
                        filePost.releaseConnection();
                    }

  }
  public void generateFile() throws SQLException {
          CallableStatement cs;

          DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

          Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@192.1.1.1.:1521:PROD", "jan", "lte");


          String sql = "BEGIN SUB.WEB_INTERFACE.GENERATE_VOIP; END;";

          PreparedStatement pstmt = conn.prepareStatement(sql);

          pstmt.execute();


          pstmt.close();
          conn.commit();
          conn.close();


    }
static public void main()  throws SQLException {

        try {
            new uploadVoip();
        }
        catch( SQLException ie ) {
            ie.printStackTrace();
        }
    }

}

ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of desiboy1974
desiboy1974

ASKER

dam..:)...forgot about that..thanks