Thanks for the extra details. If you can only use Java and TSQL, then your options are somewhat limited because the APIs for working with MSSQL are all in .NET and most third-party tools are also .NET-based.
You haven't mentioned which OS you want to run your code on, what your goal is (deployment? high availability? reporting?) or how often you need to do this (once? on demand? scheduled?) but assuming it's Windows and that you can use the MSSQL command-line tools (sqlcmd.exe, bcp.exe etc.) then here are some possibilities:
- BACKUP/RESTORE - this copies the entire database, so you can't manage individual objects and of course if you overwrite the target database then you lose all the existing data
- Replication - copies data and objects between servers, but can be complex to set up and manage
- Use Integration Services to create packages that copy data and objects between servers
- Use a third-party tool with command-line support and drive it from Java
- Write your own programs to get SQL scripts from source control and execute them against the correct databases using sqlcmd.exe; you can use bcp.exe to export and import data from specific tables
Unfortunately the Java-only restriction means that you can't use SMO, which provides a full API for managing MSSQL objects, including generating DDL for existing objects. And Visual Studio database projects are presumably also not possible, which means you cannot use VSDB deployment features.