Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

add search button in java desktop application JDBC (embedded) ?

 
Gourav Goyal
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to submit a java database project for internship. I followed this tutorial to make a Java JDBC application (yes,i'm newbee).

I successfully created a Table with ADD, DELETE, SAVE Buttons but i dont know how to Function a SEARCH QUERY button.please help me.
I'm using netbeans 6.9.1 with java DB(embedded) application.
I have attached the outlook of my application.
netbeans.jpg
[Thumbnail for netbeans.jpg]
2.jpg
[Thumbnail for 2.jpg]
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

What would this search button do? Which fields would it search, and how would it acquire the values for which to search? If you can answer these questions then I think you would be a lot closer to an answer.
 
Gourav Goyal
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Welcome to the Ranch.

What would this search button do? Which fields would it search, and how would it acquire the values for which to search? If you can answer these questions then I think you would be a lot closer to an answer.

thank you very much for quick reply..
if i write station "xyz" in station field and hit search button then it should show all the rows which have that "xyz" station name. rows and columns are visible in my pic.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So how would the SQL look like that returns all records having "xyz" in the station name?
 
Gourav Goyal
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:So how would the SQL look like that returns all records having "xyz" in the station name?
Exactly like this (attachment) and if you want i can provide the source code
2.jpg
[Thumbnail for 2.jpg]
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so you have an idea how the GUI would work, and you say you know how to construct the SQL from those inputs you get via the GUI. So what exactly prevents you from implementing it?
 
Gourav Goyal
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:OK, so you have an idea how the GUI would work, and you say you know how to construct the SQL from those inputs you get via the GUI. So what exactly prevents you from implementing it?

that image was hypothetical, i don't know the coding behind search button neither i know how to construct SQL from those inputs i get via that GUI text field. please help, i have to submit project tomorrow.
i would be obliged if you can look at the source code here
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frankly, I doubt that anyone will check out the source code. It sounds as if you have bitten off more than you can chew in one go, so I suggest to break it down into more manageable chunks. Start by creating and testing a SQL statement that will search your data when given "xyz", and which returns exactly those records you think it should find. You should not do this in Java code, but rather use the DB's command line tool (or a JDBC GUI client).

As to question about how the GUI can support this, that has nothing to do with JDBC or DBs, so you should start a new topic in the Swing / AWT / SWT forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic