Hi Phani,
First, OutSystems no longer directly supports Java. The Java backend is no longer available in the latest version of the Platform, version 11. The last version supporting Java was version 10, but this version is no longer supported.
Secondly, even if Java were supported, using existing code as-is in OutSystems wouldn't be possible. OutSystems generates Java (up to version 10) or .NET code from the OutSystems visual code. It is possible to include external code if it's in libraries through creating an Extension, but this is not encouraged and would still be quite some work if you have a lot of existing code.
As for your last question, connecting to an MSSQL database is easily possible. See here for more details.