Generic JSP Code to retrieve information from the database.? The Database names, Information to be retrieved and other sql clauses are parameters sent through the JSP Call / URL call.?
## Deliverables
A Simple JSP code that will query a database and return requested details.
A properties file that will hold the database information + JDBC configuration information (as required). Please be aware this may be different for different databases
[login to view URL]
-------------------------------
DBTAG ABC
DBHOST [login to view URL]
DBNAME DEVLOC
DBUSER testuser
DBPASS test
DBTAG XYZ
DBHOST [login to view URL]
DBNAME DEVWRLD
DBUSER DEVL
DBPASS 1234
the JSP will be called as a url with parameters in the url
The parameters would be
Parm 1 column to be retrieved - This will be an IMAGE most of the times - but can also be a normal text column.
Parms 2 and 3
Parm2 the key column names
Parm3 the key values
Parm 4?
database tag? (mentioned in the properties file)
Columns may contain images and images needs to be returned as an image (BLOB)
<http://websrver/[login to view URL]?Parms2=Key?Parms3=12345dbtag=ABC>?
The above will generate sql
select columnname from ABC where key=12345
or
<http://websrver/[login to view URL]?Parms2=Key1,key2?Parms3=12345,ABCDEdbtag=ABC>?
select columnname from ABC where key=12345 and key2='ABCDE'
And the JSP should make a JDBC Call to the database run the query and return the requested columns.
IF the Developer is smart enough - you can add more sql parsing building rules and make it possible to include AND / OR conditions in the where clause.
The JSP will be hosted in our Webapp server and called from within out application to return the requested values.