Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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

 
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22644
123
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this also good for finding the contents in the database?
Thanks
Jack
 
The overall mission is to change the world. When you've done that, then you can read this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic