The error message is as follows:
Exception in thread "main" Java.lang.SecurityException:Invalid signature file Digest for Manifest main attributes
On the internet, said to need to re-hit SQLJDBC http://blog.chinaunix.net/uid-26706281-id-3210704.html
Copy the contents of the blog:
Plug-in into the jar package run this exception, exception handling methods
1. Extract the source Sqljdbc.jar drive to the SQLJDBC directory
2. Delete files outside Mainfest.mf,zigbert.rsa in the sqljdbc\meta-inf\ directory.
3, modify the MAINFEST.MF in the sqljdbc\meta-inf\ directory, keep the first row, the rest of the deletion
4, RePack: Enter the SQLJDBC directory, execute: Jar CVF Sqljdbc.jar. Note that the last point number cannot be dropped (with a space)
5. Add the newly packaged documents to project projects.
RePack Run, OK
Then I repackaged it because of Maven, so I needed to put the package back into Maven, and my path was
D:\maven\work\com\microsoft\sqlserver\sqljdbc4\4.0
Name must be consistent, my name here is Sqljdbc4-4.0.jar
At the same time, you need to modify the content in Sqljdbc4-4.0.jar.md5 and SQLJDBC4-4.0.JAR.SHA1.
I am using hashmyfiles this software to get the MDT and SHA1, as follows
Http://www.crsky.com/soft/12505.html
Once the above is complete, let eclipse re-reference the SQLJDBC
Ok
Using SQLJDBC to connect the MSSQL database, the MAVEN generated jar is run and reported "Exception in thread" main "java.lang.SecurityException" error