Excel spreadsheet import tool
I need to import Excel tables into Java objects. I will be using POI to complete the task (it's an old version unfortunately). However, I'm wondering if there is some kind of high-level framework to accomplish the same task, but declaratively. I think in Castor and XML. The Excel class mapping will be stored in a resource (for example, an XML file). Yes, I'm lazy bones. But I don't like having a lot of hardcoded POI instructions when the user decides to change the input format.
thanks
+1
a source to share
3 answers
Always JDBC-ODBC modem comes with JVM
import java.lang.*;
public class jdbcodbc {
public static void main(String[] args) {
// Attempt to load database driver
try
{
// Load Sun jdbc-odbc driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
}
catch (ClassNotFoundException cnfe) // driver not found
{
System.err.println ("Unable to load database driver");
System.err.println ("Details : " + cnfe);
System.exit(0);
}
catch (InstantiationException ex)
{
System.err.println ("Unable to load database driver");
System.err.println ("Details : " + ex);
System.exit(0);
}
}
}
Sun Documentation, JDBC-ODBC Bridge
Example jdbc url potentially usable in Hibernate like:
JDBC: ODBC: MYDB; UID = me; PWD = secret
0
a source to share