I figured it out the data source name has to be the same as the database name. Now I am getting another error when trying to use datainsert but it is more like a warning coz when i checked the database the data is inserted just fine.
java.sql.SQLException: SQL Exception : Conversion not supported by setObject!! at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setObject(Unknown Source) at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setObject(Unknown Source) at sun.jdbc.odbc.JdbcOdbcPreparedStatement.emulateExecuteBatch(Unknown Source) at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeBatchUpdate(Unknown Source) at sun.jdbc.odbc.JdbcOdbcStatement.executeBatch(Unknown Source) at com.mathworks.toolbox.database.writeTheData.cellWrite(writeTheData.java:284)