I wonder if there is easy way to replace jdbc4 library to mysql-connector-java lib in project, and what are the differences in code
Thanks for answers :)
(I'm doing it because there is no jdbc4 lib in maven repository )
I wonder if there is easy way to replace jdbc4 library to mysql-connector-java lib in project, and what are the differences in code
Thanks for answers :)
(I'm doing it because there is no jdbc4 lib in maven repository )
If you are talking about "jdbc4", you are probably talking about the sqljdbc4.jar
of the Microsoft SQL Server JDBC Driver. You can't just replace the SQL Server JDBC Driver with the MySQL Connector/J JDBC driver: they aren't for the same server; it would also mean replace your database and maybe rewrite some incompatible queries, and if you have used some driver-specific extensions, it would also mean rewriting those parts of your code.
Instead you should add the SQL Server driver to your local maven repository (or to your companies maven repository). See for example maven dependency for sqlserver2010?
Another option would be to specify the dependency to the driver with a systemPath to the driver local to your project (but that has some downsides).
Since a few years above suggestions for putting the dependency in a local repository or using systemPath is no longer necessary, as the driver is now in Maven Central with coordinates com.microsoft.sqlserver:mssql-jdbc
.