Mon Nov 05, 2012 9:35 pm
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
public class ReadMyFile {
public static void main(String args[]) {
Connection oracleConnection = null;
String filePath = "C://file.txt";
try {
File file = new File(filePath);
FileInputStream fileInputStream = new FileInputStream(file);
fileInputStream.read();
oracleConnection = DriverManager.getConnection("dbURL", "dbUsername", "dbPass");
} catch (SQLException ex) {
Logger.getLogger(ReadMyFile.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException e) {
e.printStackTrace();
}
}
}
try {
File file = new File(filePath);
FileInputStream fileInputStream = new FileInputStream(file);
fileInputStream.read();
oracleConnection = DriverManager.getConnection("dbURL", "dbUsername", "dbPass");
} catch (SQLException | IOException ex) {
ex.printStackTrace();
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.