Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: islandzThanks Stonysmith. Please forgive me, but a) I'm pretty new to Lavastorm; and b) I'm fairly Noob at java programming. I have found a couple of options to use a JDBC driver, but I am not sure how to specify the data source being the input peg, as opposed to the SQL statement. I am looking at using the code below:
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String connString="jdbc:odbc:Driver={Microsoft dBASE Driver (*.dbf)};DefaultDir=E:\\db";//DeafultDir indicates the location of the db
Connection connection=DriverManager.getConnection(connString);
String sql="SELECT * FROM table_name where condition";// usual sql query
Statement stmt=connection.createStatement();
ResultSet resultSet=stmt.executeQuery(sql);
while(resultSet.next())
{
System.out.println();
}
System.out.println();
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
catch (SQLException e)
{
e.printStackTrace();
}