DataStoreAdapterException in IBM WAS connect to SQL server DB - java

I am not able to connect the Sql server db from IBM WAS6. It throws below exception, I already added sqljdbc4.jar in classpath.
com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException: DSRA8050W: Unable to find the DataStoreHelper class specified: com.ibm.websphere.rsadapter.MicrosoftSQLServerDataStoreHelper
Not sure is it requires any new JAR file? Can you please help me to solve the issue.

Related

What version of sqljdbc do I require?

I am running in to an issue with my application where I get the error.
The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SQL Server returned an incomplete response."
I have looked and the only difference on my new server is version of SQL which leads me to think I have the wrong version of SQLJDBC4.jar
I have been looking for a version that works with Java version 1.6.0_27 and MS SQL Sever 2017
Does anyone have any suggestions of what version of this JAR I require?
Please try to add the "sqljdbc42-0.jar" file to your build path.
Try the following link if it is maven project, else download the jar from any trusted url.
https://mvnrepository.com/artifact/com.microsoft.sqlserver/sqljdbc42/6.0.8112

Java connect to a remote MS SQL server database

I am trying to connect to the database on the remote MS SQL server, using the provided connection string. The connection string is as follows:
data source=qsss.gar.de\SQL2012,3000;initial catalog=City;persist security info=True;user id=usr;password=usr##2009;
I understand I should have the suitable drivers, so I have downloaded the SQL Server drivers from microsoft.com/download/en/details.aspx?id=21599
, and added them to the build path of my project. Those are sqljdbc.jar and sqljdbc4.jar.
I am just using this test code to see if the connection is established.
public static void main(String[] args) throws Exception {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
Connection connection = DriverManager.getConnection(
"qsss.gar.de\SQL2012,3000;initial catalog=City;persist security info=True;user id=usr;password=usr##2009;");
System.out.println("Connected!");
}
Doing so, I get an error: Java Runtime Environment (JRE) version 1.8 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
What am I doing wrong here?
Do not add both jars to your classpath since they both contain the com.microsoft.sqlserver.jdbc.SQLServerDriver-class and in your situation the program loads the one from sqljdbc.jar. Remove sqljdbc.jar from your classpath and only add sqljdbc4.jar so your program will always load the correct driver-version.

Class [org.apache.derby.jdbc.ClientDriver] not found Exception [duplicate]

This question already has an answer here:
Class [org.apache.derby.jdbc.ClientDriver] not found. When trying to connect to db
(1 answer)
Closed 7 years ago.
![JAVADB_DRIVER_LABEL library missing][1]
I am trying to connect to a JavaDB through netbeans 8 IDE on Windows 7. i can connect it using the DB manager provided with netbeans in Services panel. But when trying to connect it through my code I get ClassNotFoundException for the org.apache.derby.jdbc.ClientDriver class.
I could not run the Apache tomcat server on my machine, so I am Using the Glassfish server 4 that comes with netbeans.
my code to connect to the DB is as follows:
String url = "jdbc:derby://localhost:1527/sample;UID=app;PWD=app";
Class.forName("org.apache.derby.jdbc.ClientDriver");
conn = DriverManager.getConnection(url);
This similar code worked with SQL server, MS Access.
Please add your jdbc driver to the classpath of your project. It should work.
Currently, the class loader is unable to load your driver class as it does it does not find it in the classpath
Download the version of Apache Derby you need from here. Extract the zip and you should get derbyclient.jar which has the class org.apache.derby.jdbc.ClientDriver.
FYI : If your application runs on JDK 1.6 or higher, then you do not need to explicitly load the EmbeddedDriver. In that environment, the driver loads automatically.
You need to add derbyclient.jar to your classpath. You can find this jar in the download package of derby from here. This jar contains your org.apache.derby.jdbc.ClientDriver.
For more information, see this answer : where is org.apache.derby.jdbc.ClientDriver?

Error: java.sql.SQLException: No suitable driver found for jdbc:sqlserver

I have a wowza server (built with Java) and need it to save logs to a SQL Server 2005 Database. I downloaded the sqljdbc4.jar jar file from Microsoft and placed it in C:\Program Files\Java\jre6\lib\ext. I also added the classpath to a windows variable, but am getting this error:
java.sql.SQLException: No suitable driver found for jdbc:sqlserver
These are the wowza configuration settings for SQL server:
log4j.appender.SQ=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.SQ.Driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
log4j.appender.SQ.URL=jdbc:sqlserver:\\Myserver;databaseName=WowzaLog
log4j.appender.SQ.user=sa
log4j.appender.SQ.password=123
log4j.appender.SQ.layout=com.wowza.wms.logging.ECLFPatternLayout
log4j.appender.SQ.layout.OutputHeader=false
log4j.appender.SQ.sql=my insert SQL
It's not a wowza problem. It's something related to JAVA but I'm not a Java expert.
Thanks
Does Wowza have any lib folder? This would typically have lots of jar files in it that wowza would need to use.
Normally you put the JDBC driver jar file in there not in the Java runtime ext environment.
Also the Database path seems wrong. It needs to have forward slashes not backslashes. It needs to be like this:
jdbc:sqlserver://server:port;DatabaseName=dbname

can oci driver for 11g (odbc5.jar) work with 10g client?

I need to connect to Oracle9,10 and 11 in my java application.The client will always be present where the app will be run and I want the app to just work with username,password and instance (specified in tnsnames.ora).Hence I would like oci drivers with a connection string of type : jdbc:oracle:oci:#testora .Im using the driver: oracle.jdbc.driver.OracleDriver.
I have a 10g client and am using jdk1.5. When I use the ojdbc14 jar from client lib path the app runs.
But if I use the ojdbc5 driver then the app fails with
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc11 in java.
library.path
exception.
What im looking for is a way to package a single jar(ojdbc5/ojdbc14) and a single driver which will use oci drivers to connect to the client that is present on local machine(9/10/11).This is the way I would prefer it.
If this is not possible can I search the unix box for oracle version,pick up the correct jar and then use it in classpath when invoking the app which is in jar format?
Thanks,
Fell
java.lang.UnsatisfiedLinkError: no ocijdbc11 in java.library.path
This means that you are missing a DLL (ocijdbc11.dll) in the Java library path. Make sure you have that DLL and start your program like this:
java -Djava.library.path=C:\mydirwiththedll com.mypackage.MyProgram
ojdbc5.jar is intended to work with jdk1.5.x either you are connecting to Oracle 10 or 11g shouldn't matter, ojdbc14.jar was intended for jdk1.4.x

Categories