title: how the user would give the full path of a file using java
body: <p>i have a problem and i think that someone maybe could help me because i am a little bit confused.
  I had made a program where i am reading excel files and i am storing their data in a database.
  In this database each excel file create a table. I have made the program and everything works fine up to here. Now, after the connection that i had done, i would like the user to be able to give the full path of the file that would read in the client and afterwards to continue the rest of the program, read the data and store them in a table. Could anyone help me how i would do this?  Below is the code for connection.</p>
  
  <pre><code>public static void main (String[] args) throws Exception {
          try {
              System.out.println("get the connection");
          }
          catch( Exception e )
           {
           System.out.println( "SQLException: " + e.getMessage() );
           }
  
          Class.forName("com.mysql.jdbc.Driver");
          Connection con = (Connection) DriverManager.getConnection(
                  "jdbc:mysql://localhost:3306/kainourgia", "root", "root");
          DatabaseMetaData meta = (DatabaseMetaData) con.getMetaData();
          ResultSet res = meta.getCatalogs();
          System.out.println("List of the databases: ");
          while (res.next()){
              System.out.println (" " +res.getString(1));
          }
          //String filename = "C:\\Users\\myfiles\\Documents\\test5.xls";
          String fullPath = "C:\\Users\\myfiles\\Documents\\test5.xls";
          String Path = "C:\\Users\\myfiles\\Documents\\";
          String filename = "test5.xml";
          String[] parts = filename.split("\\.");
          String tablename = parts[0];
  </code></pre>
  
  <p>Could anyone help me?</p>