I have connect MSSQL server through java using following Code
Connection conn = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;DATABASENAME=;instanceName=MSSQLSERVER", "DB_USER_NAME", "DB_PASSWORD");
After that I am able to connect database and execute sql script without giving any object name. for example
SELECT * FROM TEST_TABLE
Now, I have some tables which are got created under dbo and I want to access them using same connect.
How Can I go with this?
I have try with
SELECT * FROM dbo.TEST_TABLE1
but it says that this table is not there in database.
SELECT DB_NAME() AS currentdband verify that you are actually using the database you think you are using. If so, then log into SQL Server Management Studio (SSMS) with the same credentials you are using in your Java code and try to access the dbo. tables that way.