• Post Reply Bookmark Topic Watch Topic
  • New Topic

How would I do a all-round searching for all tables of the database?

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Say I type in "Hello" in a textfield,
Everything associated with hello in my database will pop up,
Just like the search bar of windows 7
I am doing it in Java + MariaDB. Thanks
Jack
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jacky Luk wrote:Say I type in "Hello" in a textfield,
Everything associated with hello in my database will pop up,
Just like the search bar of windows 7
I am doing it in Java + MariaDB. Thanks
Jack



I have discovered this on the web


I right clicked on the create context menu bar of mariaDB, then select create stored procedure and paste this into the pane,
but it says there is syntax error near "proc"
Thanks
Jack
 
Rob Spoor
Sheriff
Posts: 20831
68
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java, you can retrieve all tables names using the JDBC API:
This code includes using the identifier quote string. For some database servers this is ", for some `, in your case it's probably '.

You can then use simple SELECT queries in JDBC to check for the data. Just do a "SELECT * FROM " + table, then loop over the results and use ResultSetMetaData to get the number of columns.
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this also good for finding the contents in the database?
Thanks
Jack
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!