Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
String fn = "V:\\\\Devt\\\\ProjA\\\\test3.dat";
String tb = "tblFlat";
sqlText = "LOAD DATA INFILE \"" + fn + "\" INTO TABLE " + tb + " (line)";
UpdateTableBuilder utb = new UpdateTableBuilder(drvConn, urlConn, uidConn, pwdConn);
utb.executeUpdateTable(sqlText);
import java.sql.*;
import javax.swing.table.*;
public class UpdateTableBuilder {
Connection connection;
public UpdateTableBuilder(String drvConn, String dbnConn,
String uidConn, String pwdConn)
throws ClassNotFoundException, SQLException
{
Class driver = Class.forName(drvConn);
connection =
DriverManager.getConnection(dbnConn, uidConn, pwdConn);
}
public int executeUpdateTable(String query)
throws SQLException
{
if (connection == null)
throw new
IllegalStateException("Connection already closed.");
Statement statement =
connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
int n = statement.executeUpdate(query);
return n;
}
protected void finalize() { close(); }
}
sqlText = "LOAD DATA [b]LOCAL[/b] INFILE \"" + fn + "\" INTO TABLE " + tb + " (line)";
public void setSQL(String rdbms, String file, String table) {
StringBuffer sb = new StringBuffer();
file = file.replaceAll("\\\\", "/");
if (rdbms.equals("mysql")) {
sb.append("LOAD DATA LOCAL INFILE ");
sb.append("'");
sb.append(file);
sb.append("'");
sb.append(" INTO TABLE ");
sb.append(table);
sb.append(" (line);");
sqlText = sb.toString();
}
}