Thanks to the solution of https://community.ptc.com/t5/ThingWorx-Developers/Using-a-third-party-Jar-file-for-Database-connection/td-p/514861. Here are the steps to connect to MSSQL Database.
1.metadata.xml
<Entities>
<ExtensionPackages>
<!-- The name attribute of the ExtensionPackage element correlates to the name of the zip archive for the extension -->
<ExtensionPackage name="DatabaseMSSQL_ExtensionPackage" description="DatabaseMSSQL JDBC Extension" vendor="write something" packageVersion="1.0" minimumThingWorxVersion="5.0.0">
<JarResources>
<!-- The JDBC JAR file being used to connect to DatabaseXYZ -->
<FileResource type="JAR" file="sqljdbc4-2.0.jar" description="DatabaseMSSQL JDBC JAR"/>
</JarResources>
</ExtensionPackage>
</ExtensionPackages>
<ThingTemplates>
<!-- A Database ThingTemplate for the DatabaseXYZ extension -->
<ThingTemplate name="DatabaseMSSQL" baseThingTemplate="Database" description="DatabaseMSSQL ThingTemplate"/>
</ThingTemplates>
</Entities>
2. Created a folder lib/common and saved mssql jar file in common.
3. Selecte lib and metadata.xml and created zip folder.
4. Imported as extension in Thingworx platform.
5. Created a thing (MSSQL_Database) with base Thing template created after step 4. (In my case DatabaseMSSQL) and save.
6. Edit MSSQL_Database thing's configurations as follows:
JDBC Driver Class Name: com.microsoft.sqlserver.jdbc.SQLServerDriver
JDBC Connection String: jdbc:sqlserver://<twServer>\<MSSQL instance>;databaseName=<your database>
connectionValidationString: SELECT 1
7. Save
Finally, it is connected.