• Post Reply Bookmark Topic Watch Topic
  • New Topic

retrieve path name  RSS feed

 
Sama Mushtaq
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

So im working on a project where im supposed to dynamically load the contents of a .csv file into the database.I have been hard coding the path of the file till now like

inserted = insertFromFile("C:/Users/Student/Desktop/Book1.csv",connection, "customer");

however now i have to read multiple files from a folder and integrate the program with a GUI. I have 2 questions:

a)how do i read multiple files from a folder b)how do i retrieve the path of a file for the insert statement

any help is appreciated.

Thanks!
 
Panagiotis Kalogeropoulos
Rancher
Posts: 99
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should check the File class in java.io. It has methods to get all files from a folder and the pathname of a file (plus many more of course).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!