Welcome, Guest. Please login or register.
Did you miss your activation email?
Pages: [1]   Go Down
  Print  
Author Topic: JDeveloper - execute with parameters  (Read 1500 times)
0 Members and 1 Guest are viewing this topic.
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« on: July 10, 2007, 10:33:48 AM »

Since my JDeveloper project has succesfully finished, I can post a bit about the stuff that you might need to make with JDeveloper.

This is how you can make a search field that takes parameters: (I got this from my classmate, he showed me how to do this)
Go to your modelview, double click on the viewObject, go to SQL statements and insert your SQL.

Example 1):

Code
GeSHi (oracle8):
  1. SELECT Werksoorten.NAAM,
  2.       Werksoorten.WERKSOORT_ID
  3. FROM WERKSOORTEN Werksoorten
  4. WHERE Medewerkers.ACHTERNAAM LIKE '%' || :CustAchterNaam || '%' AND Medewerkers.WOONPLAATS LIKE '%' || :CustWoonplaats || '%'
  5.  
Created by GeSHI 1.0.7.20

Example 2):

Code
GeSHi (oracle8):
  1. SELECT Medewerkers.MEDEWERKER_ID,
  2.       Medewerkers.VOORNAAM,
  3.       Medewerkers.ACHTERNAAM,
  4.       Medewerkers.GESLACHT,
  5.       Medewerkers.GEBDATUM,
  6.       Medewerkers.STRAAT,
  7.       Medewerkers.HUISNUMMER,
  8.       Medewerkers.POSTCODE,
  9.       Medewerkers.WOONPLAATS,
  10.       Medewerkers.EMAIL,
  11.       Medewerkers.VESTIGING_ID,
  12.       Medewerkers.TELEFOONNR
  13. FROM MEDEWERKERS Medewerkers
  14.  
  15. WHERE UPPER(Medewerkers.ACHTERNAAM) LIKE UPPER('%' || :CustAchterNaam || '%') AND UPPER(Medewerkers.WOONPLAATS) LIKE UPPER('%' || :CustWoonplaats || '%')
Created by GeSHI 1.0.7.20

The second example will enable you to search for ALL text(s) that contains in the search criteria.

Example:
This is a string in the database: EngineerinGserver.com
If you are searching for: ringserver the first example will return 0 results because it will search for the literal text. The second example will change ALL text in uppercase so it will find the match regarding if the original search string is in an uppercase or not..


Next go to the "Bind variables" and add "CustAchterNaam" and "CustWoonplaats" Both types are: String
Change labelText: Go to the "control hints" in the "Bind variables" and change/add the text in the "Label text" field.

After you are done click OK and go to the viewController. Create a new page by click with your right mouse on the "New..." choose: web tier -> jsf and name the page whatever you want. After that go to the "Data Control Palette" click the "+" and drap & drop the "ExecWithParams" in your JSF page. You can now test the page by right clicking with your mouse and select "Run"

Screenshots:
http://www.engineeringser...c0d3z/tpmod.html;dl=item5
http://www.engineeringser...c0d3z/tpmod.html;dl=item4
http://www.engineeringser...c0d3z/tpmod.html;dl=item6
« Last Edit: July 10, 2007, 05:39:16 PM by HappyFace » Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here