java读取.csv文件并插入到oracle中,谁有源码,能不能给我发一份
------解决思路----------------------
参考读取/
------解决思路----------------------
读取csv文件,并返回一个 泛型字符串数组
public List<String[]> readCSV(String fileName)
{
File file = new File(fileName);
InputStreamReader reader = null;
List<String[]> fileContext = null;
BufferedReader br = null;
try {
if (file.isFile() && file.exists())
{
fileContext = new ArrayList<String[]>();
reader = new InputStreamReader(new FileInputStream(file));
br = new BufferedReader(reader);
String tempReadText = "";
while((tempReadText = br.readLine()) != null)
{
String[] tempArray = tempReadText.split(",");
fileContext.add(tempArray);
}
}
for(String[] val : fileContext)
for(String v : val)
System.out.println(v);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return fileContext;
}