Error: java.sql.SQLException: No suitable driver found for jdbc:sqlserver
I have wowza server (built with Java), and need it to save logs to SQL Server 2005 Database, I downloaded this jar file from Microsoft sqljdbc4.jar I put in C:\Program Files\Java\jre6\lib\ext , also added classpath to windows variable, but I got this error:
java.sql.SQLException: No suitable driver found for jdbc:sqlserver
this is the wowza configrations for SQL server:
Code:
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
I copied my jar to Wowza lib folder ,but I still have the same error
It's not a wowza problem ,it's something related to JAVA and I'm not a Java expert.
Thanks
Re: Error: java.sql.SQLException: No suitable driver found for jdbc:sqlserver
"I put in C:\Program Files\Java\jre6\lib\ext , also added classpath to windows variable"
Both of those are wrong.
The first might cure the problem, but is a hack, and the second is unlikely to work except when running a Java app with no defined classpath of its own, which is a rare thing indeed.
So, you need to tell Wowza where this jar file is located (and I'd stick it with the other Wowza libraries, as you have done). So it is a Wowza problem, in that you need to figure out how it is set up.
Re: Error: java.sql.SQLException: No suitable driver found for jdbc:sqlserver
I made a change to my connection code and I got this new error message:
Code:
Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0. ERROR server comment Wowza Media Server 2 Perpetual 2.2.3 build26454 server core failure: java.lang.UnsupportedOperationException: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
I'm using sqljdbc4.jar already
Re: Error: java.sql.SQLException: No suitable driver found for jdbc:sqlserver
Which implies it's not found that jar file, but a different one.
Or there's two on the classpath and it's simply grabbed the first (incorrect) one.
Re: Error: java.sql.SQLException: No suitable driver found for jdbc:sqlserver
Well, I fixed that jar error, now I have a new one :D
Quote:
ERROR Failed to excute sql
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host PC1//LOCAL2005, port 1433 has failed. Error: "null. Verify the connect
ion properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to
the port are not blocked by a firewall.".
My SQL server instance name like this : PC1//LOCAL2005. I'm using SQL2005 and TCP/IP is enabled.
Re: Error: java.sql.SQLException: No suitable driver found for jdbc:sqlserver
I seem to remember there being a good article at Microsoft about getting this to work.
Check the port number. SQL Server can assign random ones at times, if some set up isn't checked.