0

I have some data stored in ODBC, and those data look like this:

enter image description here

Does anyone use calculated fields or other functions to display ODBC data in XPages?

I need to display the data stored in ODBC in XPages, and then write other data to save back to ODBC.


Originally used ASP to write this function, the writing method is as follows:

Set conn = Server.CreateObject("ADODB.Connection")
conn.open b8_dsn

SQL = "SELECT PONUM as PONUM,COMP_NAME as Company,CASENAME AS Case_name,PRICE as Price" 
SQL = SQL & " FROM CB4_AUCTION"
Set rs = conn.Execute(SQL)
Ariel
  • 57
  • 6
  • Of course you might want to explore a code free option. The DECS service can connect Notes databases to RDBMS and keep the data in sync. Some reading about it: https://www.wissel.net/blog/2009/09/domino-and-rdbms.html https://www.wissel.net/blog/2008/11/advanced-decs-usage.html – stwissel Sep 23 '20 at 20:28

1 Answers1

1

Your best course of action is to encapsulate the ODBC (actually more JDBC) data into a managed bean. Design one property of the bean to be like

  public List<SomeData> getRows();

and you can use beanName.rows directly in a repeat control as data source. Design the SomeData as Java bean (which is fancy for: having getSomeValue(), setSomeValue(...) pairs of methods, so you can directly bind them to a form using beanInstanceName.someValue (where beanInstanceName is the variable name of your repeat control)

You can read about bean data binding here:
https://wissel.net/blog/2011/01/binding-controls-to-managed-beans.html

And how to save yourself some headache by creating and testing your bean outside of XPages first here:
https://wissel.net/blog/2013/06/managed-beans-xpages-and-testability.html

You want to use the extension library, which comes with ODBC/JDBC stuff and check related questions:

Let us know what worked for you!

stwissel
  • 20,110
  • 6
  • 54
  • 101