Hello,
I ghave configured an iView which implements a JDBC connection to my SQLServer, let's call it "myJDBC".
Can someone please show me a simple code example
(including relevant descriptors)of another iView which uses the JDBC iView in order to Query the Database and display the results?
Hi Roy,
If you want to display the results you can do that using table. Use PageProcessorComponent and JSP's.
Have a method in the main java class which gets you the data from SQL Server. Create a system dsn and use the code
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection( "jdbc:odbc:mydsn,"servername","poassword");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from table");
populate the values in the tableview model and display them in JSP.
follow the examples in PDK, under TABLEVIEW control. Let me know if you need anything else.
Thanks,
Praveen
Hi,
I assume by JDBC iView you mean that you have created a system that points to a database. <i>Not</i> JDBC iView as if you had created one of these you would already be able to configure the output at the time of the iView creation.
What Praveen has said is correct one way is to do a custom development using JSP. (He makes it sound easy!).
There are a number of options using the standard iViews provided out of the box rather than getting into java code.
There are two types that are quite basic but easily configurable.
They are JDBC Stored Procedure iView & Query iView.
The stored procedure iView obviously requires a stored procedure on the database that provides a response.
The iView creation wizard will enable you to be able to browse and select your stored procedure and for the query iView you should be able to select the tables etc and organise there output inside the wizard.
If you have difficulty when creating these iViews check you configured the system correctly so make sure you follow the steps of:
Create Alias on the system and Test connection
Provided usrpwd details to DQE on the system.
Configured your user mapping to the Alias using the personalize option on the portal header.
Once you have this all working you might like to look at a bigger challenge and get unification iViews working...
See Weblog :
Add a comment