How to detect a SQL table's existence in Java?

0 votes
How can I detect if a certain table exists in a given SQL database in Java?
May 13 in Database by kartik
• 27,360 points
106 views

1 answer to this question.

0 votes

Hello,

Depending on the DB, you can do (MySQL)

SHOW TABLES

or (Oracle)

SELECT * FROM user_objects WHERE object_type = 'TABLE'

or 

another thing for SQL Server. 

Cycle through the results for MySQL or further filter on the Oracle one.

Hope this help!!

answered May 13 by Niroj
• 58,960 points

Related Questions In Database

0 votes
2 answers

How to select the nth row in a SQL database table?

SELECT * FROM ( SELECT ID, NAME, ROW_NUMBER() ...READ MORE

answered Apr 23 in Database by anand
• 140 points
3,383 views
0 votes
1 answer

How to do a batch insert in MySQL

You can try out the following query: INSERT ...READ MORE

answered Sep 10, 2018 in Database by Sahiti
• 6,320 points
1,046 views
0 votes
1 answer

How to schedule a job for SQL query to run daily?

down voteaccepted Expand the SQL Server Agent node ...READ MORE

answered Oct 25, 2018 in Database by Frankie
• 9,810 points
1,872 views
0 votes
1 answer

How to cache data in a MVC application?

Reference the System.Web dll in your model ...READ MORE

answered Oct 25, 2018 in Database by Frankie
• 9,810 points
591 views
0 votes
1 answer

Error:Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

Hii @kartik, I was also facing the same ...READ MORE

answered May 13 in Database by Niroj
• 58,960 points
401 views
0 votes
0 answers

Anyone can help me out to understand the semantic of (document.getElementBYId("demo").innerHTML="Hello") ?

Hello guys, Can Someone helps me to find ...READ MORE

Jan 17 in Web Development by anonymous
• 27,360 points
86 views
+1 vote
1 answer

What is the relationship between angularjs Scope with controller/view?

Let us consider the below block: <div ng-controller="emp"> ...READ MORE

answered Jan 20 in Web Development by Niroj
• 58,960 points

edited Jan 21 by Niroj 125 views
0 votes
1 answer

How to schedule a job for sql query to run daily?

Hii, To schedule a job for sql query ...READ MORE

answered May 4 in Database by Niroj
• 58,960 points
203 views
0 votes
1 answer

Sir please tell me how to import image in database?

Hello soumadip, (Assuming you are using mysql database) You ...READ MORE

answered Apr 1 in Database by Niroj
• 58,960 points
100 views