I want to use my Informix JDBC application over SSL. The DBMS is Informix IBM 11.70.
I'm using a spring-config.xml file in which I declare the datasource bean:
<!-- Data source -->
<bean id="dataSource" class="com.sopra.datasource.CustomDataSource" init-method="init"
destroy-method="close">
<property name="url" value="${url}" />
<property name="driverClassName" value="${driverClassName}" />
<property name="username" value="${username}" />
<property name="password" value="${password}" />
<property name="removeAbandoned" value="true" />
<property name="initialSize" value="20" />
<property name="maxActive" value="30" />
</bean>
The problem is that when I deploy my application in Tomcat 7 everything goes well (both TCP and SSL mode), however, when I deploy it in JBOSS 7.1 the SSL connexion mode to the Informix database doesn't work!
When it comes to debugging, the only information that I have is the following :
Application side:
Caused by: com.informix.asf.IfxASFException: Attempt to connect to database server (my_server_ssl) failed.
at com.informix.util.IfxErrMsg.getLocIfxASFException(IfxErrMsg.java:751) [jdbc-4.10.7.20160517.jar:4.1.0.SNAPSHOT]
at com.informix.asf.Connection.openSocket(Connection.java:1864) [jdbc-4.10.7.20160517.jar:4.1.0.SNAPSHOT]
at com.informix.asf.Connection.<init>(Connection.java:427) [jdbc-4.10.7.20160517.jar:4.1.0.SNAPSHOT]
at com.informix.jdbc.IfxSqliConnect.<init>(IfxSqliConnect.java:1416) [jdbc-4.10.7.20160517.jar:4.1.0.SNAPSHOT]
... 47 more
Caused by: java.lang.NullPointerException
at com.informix.asf.Connection.getEnabledSSLProtocols(Connection.java:2242) [jdbc-4.10.7.20160517.jar:4.1.0.SNAPSHOT]
at com.informix.asf.Connection.openSocket(Connection.java:1805) [jdbc-4.10.7.20160517.jar:4.1.0.SNAPSHOT]
... 49 more
Thanks in Advance.
This was due to a defect in the 4.10.7 version of the driver. Try upgrading to either 4.10.8 or 4.10.9 versions. They can be found via maven or through your IBM download site.
Gradle
compile group: 'com.ibm.informix', name: 'jdbc', version: '4.10.9'
Maven
<dependency>
<groupId>com.ibm.informix</groupId>
<artifactId>jdbc</artifactId>
<version>4.10.9</version>
</dependency>
Related
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/abc" />
<property name="username" value="root" />
<property name="password" value="root" />
</bean>
I have updated MySQL Connector/J to 8.0.14 but still getting the same error.
Thanks in advance.
Try the below command. It might solve.
sample username / password => student / pass123
ALTER USER 'student'#'localhost' IDENTIFIED WITH mysql_native_password BY 'pass123';
How to resolve Unable to load authentication plugin 'caching_sha2_password' issue(SO)
If above doesn't work try to use MYSQL driver which supports MYSQL 8.
MySQL and Java Versions They Support
Installed mysql 5.5 version and it worked fine with that.
Thanks for your help.
I'm trying to optimize the performance of querys from my Java application to the Oracle database, because the same querys doing by sql developer tool are faster than by the java application.
I have two different database (one to test/developer and the other for production).
The developer database version is: 11g Enterprise Edition Release 11.2.0.1.0 - 64bit
The production database version is: 11g Enterprise Edition Release 11.2.0.3.0 - 64bit
My java application was using ojdbc14 driver, that works fine for both databases, but the performance querys are working slowly. So after investigate, I read that a good way to start to improve the performance was using the correct ojdbc driver in the java application (according the database version). So I downloaded the ojdbc6 driver (for 11.2.0.3 oracle version). That work fine in the developer database, but i have the next error when im trying to connect the production database:
java.lang.NoSuchMethodError: oracle.i18n.text.converter.CharacterConverterOGS.getInstance(I)Loracle/i18n/text/converter/CharacterConverter;
I tried with different ojdbc driver version (5, 6), but I get the same error, in the production database only.
Some help?
Sorry my english.
Regards.
Edit 1:
#CSK
I'm using Spring MVC, here is my ApplitacionContext xml for the database connection:
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.driverClassName}"/>
<property name="jdbcUrl" value="${jdbc.url}"/>
<property name="user" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<property name="maxPoolSize" value="${jdbc.maxPoolSize}" />
<property name="minPoolSize" value="${jdbc.minPoolSize}" />
<property name="maxStatements" value="${jdbc.maxStatements}" />
</bean>
<bean id="dataSourceDataStage" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.datastage.driverClassName}"/>
<property name="jdbcUrl" value="${jdbc.datastage.url}"/>
<property name="user" value="${jdbc.datastage.username}"/>
<property name="password" value="${jdbc.datastage.password}"/>
<property name="maxPoolSize" value="${jdbc.datastage.maxPoolSize}" />
<property name="minPoolSize" value="${jdbc.datastage.minPoolSize}" />
<property name="maxStatements" value="${jdbc.datastage.maxStatements}" />
I think there're some thing wrong with your classpath in production. So, if possible, try to add jar file (orai18n.jar) directly to your project and recheck again.
In my case, it worked & Hope it help!
I am fairly new to ApacheCamel and I am trying to integrate a TeraData DB call to our database and I cannot figure out the below error message. In addition, I am running this in fuse.
2016-01-22 16:17:36,725 [Blueprint Extender: 1] ERROR org.apache.aries.blueprint.container.BlueprintContainerImpl - Unable to start blueprint container for bundle fuse-maria-bundle
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to find property descriptor URL on class com.teradata.jdbc.TeraDriver
What I have done so far is added the below in my blueprint.xml
<bean id="teradata" class="com.teradata.jdbc.TeraDriver">
<property name="URL" value="jdbc:teradata://[inser database connection]" />
<property name="user" value="myuser" />
<property name="password" value="mypassword" />
</bean>
I have this in my pom.xml
<dependency>
<groupId>com.teradata.jdbc</groupId>
<artifactId>terajdbc4</artifactId>
<version>15.10.00.14</version>
</dependency>
<dependency>
<groupId>com.teradata.jdbc</groupId>
<artifactId>tdgssconfig</artifactId>
<version>15.10.00.14</version>
</dependency>
...and followed the instruction from this link where I downloaded the driver from teradata.com.
In my route, I have the below code.
#Override
public void configure() throws Exception {
from("timer://testtimer?period=1000000")
.enrich("sql:select count(*) from table1?dataSource=#teradata")
.log("Processing ${body}");
}
Any ideas would help. Thanks in advance!
You have to download database drivers (terajdbc4.jar). I think, you
already have it...
Now you have to install drivers to your container (Karaf, because you wrote "Fuse").
Installing from file, windows example (if drivers not OSGi ready), Karaf console:
install -s wrap:file:///c:/install/terajdbc4.jar
or installing from Maven repository:
install -s wrap:mvn:com.teradata.jdbc/terajdbc4/15.10.00.14
Mission complete.
About converting jars:
https://access.redhat.com/documentation/en-US/Fuse_ESB_Enterprise/7.0/html/Deploying_into_the_Container/files/DeployJar-Wrap.html
UPDATED:
The problem is that class com.teradata.jdbc.TeraDriver has no properties url, URL, and so on...
I recomend you to try org.apache.commons.dbcp.BasicDataSource like this:
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" >
<property name="driverClassName" value="com.teradata.jdbc.TeraDriver" />
<property name="url" value="jdbc:teradata://[inser database connection]" />
<property name="username" value="myuser" />
<property name="password" value="mypassword" />
</bean>
Second option is org.springframework.jdbc.datasource.DriverManagerDataSource:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >
<property name="driverClassName" value="com.ncr.teradata.TeraDriver" />
<property name="url" value="jdbc:teradata://[inser database connection]" />
<property name="username" value="myuser" />
<property name="password" value="mypassword" />
</bean>
The error is specific to the property URL you set on the TeraDriver bean , doesnt look like that property is avaialble on the class , can you try using "url" in small case
I am trying to access a MS SQL database with apache camel. I am building it with maven as a bundle and deploy it on apache karaf.To do this I got the following in my blueprint.xml
<bean id="dataSource" class="net.sourceforge.jtds.jdbcx.JtdsDataSource">
<property name="url" value="" />
<property name="user" value="paygate" />
<property name="password" value="" />
</bean>
<service interface="javax.sql.DataSource" ref="dataSource">
<service-properties>
<entry key="osgi.jndi.service.name" value="jdbc/mssqlDatasource" />
</service-properties>
</service>
But now I am getting the following in my karaf logs
missing requirement [1374.6] osgi.wiring.package; (osgi.wiring.package=net.sourceforge.jtds.jdbcx)
This is the class that also was generated when creating the datasource in karaf with 'jdbc:create'.
Why doesn't karaf find that class?
Install the jtds jar as a bundle , using the command :
install -s wrap:mvn: net.sourceforge.jtds /jtds/1.3.0
Change version number to match your jar version, that will resolve the problem.
It is the MSSQL datasource,
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver"/>
<property name="url" value="jdbc:jtds:sqlserver://localhost:1433;databaseName=testdb"/>
<property name="username" value="sa"/>
<property name="password" value="root"/>
</bean>
Then you should install dbcp and jtds dependency in karaf container. It is working fine.
I have a Spring java web application. I am trying to use Hikaricp 2.2.5 for connection pooling with the following configuration.
Maven:
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP-java6</artifactId>
<version>2.2.5</version>
<scope>compile</scope>
</dependency>
XML:
<bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
<property name="minimumIdle" value="5"/>
<property name="maximumPoolSize" value="200"/>
<property name="dataSourceClassName" value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"/>
<property name="username" value="root"/>
<property name="password" value="root"/>
<property name="connectionTestQuery" value="SELECT 1"/>
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/app"/>
<property name="autoCommit" value="true"/>
<property name="connectionTimeout" value="30000"/>
<property name="idleTimeout" value="600000"/>
<property name="maxLifetime" value="1800000"/>
<property name="poolName" value="LoginPool"/>
</bean>
I am getting the following error NoSuchMethodError.
Exception Stack Trace:
Caused by: java.lang.NoSuchMethodError: java.sql.Connection.getNetworkTimeout()I
at com.zaxxer.hikari.util.PoolUtilities.isJdbc41Compliant(PoolUtilities.java:245)
at com.zaxxer.hikari.pool.HikariPool.addConnection(HikariPool.java:412)
at com.zaxxer.hikari.pool.HikariPool.fillPool(HikariPool.java:500)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:159)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:110)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:102)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2006)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1289)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1419)
... 109 more
How to resolve the issue?
Couple of things. The exception in your stacktrace:
at com.zaxxer.hikari.pool.HikariPool.addConnection(HikariPool.java:412)
does not line up with a call to isJdbc41Compliant() in the 2.2.5 branch. That code was removed in 2.2.5. Second, if you are using 2.2.5 and you are setting jdbcUrl you do not need dataSourceClassName, they are mutually exclusive. Try a clean build, and as a last resort go into your .m2/repositories directory and find and delete all HikariCP artifacts and let them re-download.
UPDATE: lastly, make sure you are using the latest MySQL driver if possible.