-
1. Re: Teiid Embedded, TIMESTAMPDIFF with MYSQL DataBase
shawkins Sep 4, 2014 12:01 PM (in response to jchidiac)It must be that one or both of OrderDate/ShipDate is a date, not a timestamp. If the types match exactly we automatically give preference to the system function in resolving. More than likely you are seeing this after [TEIID-3111] Function with multi-part names not resolving correctly - JBoss Issue Tracker correct?
-
2. Re: Teiid Embedded, TIMESTAMPDIFF with MYSQL DataBase
jchidiac Sep 5, 2014 1:48 AM (in response to shawkins)Both OrderDate and ShipDate are date,
i tried with the modification, one class "FunctionTree.java" is modified
and i got the same error.
-
3. Re: Teiid Embedded, TIMESTAMPDIFF with MYSQL DataBase
shawkins Sep 5, 2014 8:36 AM (in response to jchidiac)So you are saying that you are seeing this behavior both before and after TEIID-3111?
-
4. Re: Teiid Embedded, TIMESTAMPDIFF with MYSQL DataBase
jchidiac Sep 5, 2014 8:55 AM (in response to shawkins)yes
-
5. Re: Teiid Embedded, TIMESTAMPDIFF with MYSQL DataBase
shawkins Sep 5, 2014 11:01 AM (in response to jchidiac)I'll put an additional change with TEIID-3111 then to make the resolving more consistent.
-
6. Re: Teiid Embedded, TIMESTAMPDIFF with MYSQL DataBase
jchidiac Sep 8, 2014 6:57 AM (in response to shawkins)It works.
Thx.
-
7. Re: Teiid Embedded, TIMESTAMPDIFF with MYSQL DataBase
sudeepd Sep 22, 2014 4:40 PM (in response to jchidiac)Joseph,
I am trying to get teiid embedded with a mysql connection, and have been running into problems with it. (See help with teiid embedded deployVDBzip)
Looks like you have it working with mysql...can you please take a look at my sample on the link mentioned here, and see if anything jumps out ? I am just starting with teiid, and may be missing something very obvious.
-
8. Re: Teiid Embedded, TIMESTAMPDIFF with MYSQL DataBase
jchidiac Sep 23, 2014 5:34 AM (in response to sudeepd)I'm using the following codes :
public String getUrl_MYSQL(String ip, Integer port, String catalog) {
return "jdbc:mysql://" + ip + ":" + port + "/" + catalog + "?autoReconnect=true";
}
protected DataSource createMysqlDataSource(String ip, Integer port, String catalog, String user, String pw) {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName("com.mysql.jdbc.Driver");
dataSource.setUrl(getUrl_MYSQL(ip, port, catalog));
dataSource.setUsername(user);
dataSource.setPassword(pw);
dataSource.setValidationQuery("select now()" ) ;
dataSource.setRemoveAbandoned(true);
dataSource.setRemoveAbandonedTimeout(60);
//
return dataSource;
}
private String getDS(String catalog) {
return catalog + "-ds";
}
private ModelMetaData createModelMetaData( String serviceName, String translator ) {
ModelMetaData modelMetaData = new ModelMetaData();
modelMetaData.setName( serviceName + "Model" );
modelMetaData.addProperty("importer.tableTypes", "TABLE,VIEW");
//
modelMetaData.addSourceMapping(serviceName, translator, getDS(serviceName));
return modelMetaData;
}
public void deploy_MYSQL5( EmbeddedServer ebdServer, String ip, Integer port, String catalog, String user, String pw ) throws Exception {
DataSource mysqlDataSource = createMysqlDataSource(ip, port, catalog, user, pw);
ConnectionFactoryProvider<DataSource> mysqlCfp = new EmbeddedServer.SimpleConnectionFactoryProvider<DataSource>(mysqlDataSource);
ebdServer.addConnectionFactoryProvider(getDS(catalog), mysqlCfp);
ModelMetaData mysqlModelMetaData = createModelMetaData(catalog, "mysql5" );
ebdServer.deployVDB(catalog + "VDB", mysqlModelMetaData);
}
public EmbeddedServer initEmbeddedServer() {
EmbeddedServer ebdServer = new EmbeddedServer() ;
//init Translator
MySQL5ExecutionFactory executionFactory = new MySQL5ExecutionFactory();
executionFactory.start();
ebdServer.addTranslator("mysql5", executionFactory);
// start the Server
EmbeddedConfiguration embeddedConfiguration = new EmbeddedConfiguration();
embeddedConfiguration.setUseDisk(true);
ebdServer.start(embeddedConfiguration) ;
//
return ebdServer ;
}