application development with the sybase toolset

25
Page 1 MARCH/APRIL 2000 PRICE: US$ 7.50 VOL. 7 / ISSUE 2 JOURNAL FOR PEOPLE INTERESTED IN CLIENT/SERVER AND INTERNET APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET Contents Editorial: Sybase TechWave 2000 by Rolf André Klaedtke Impressum on Page 2 The Vision: What’s in Store from Sybase in 2000 ? by Scott McReynolds on Page 3 Internet Aware: Internet-Aware PowerBuilder Applications, Part III by Roy Kiesler on Page 7 COM Knowledge: COM+ Security by Alan J. Walsh on Page 10 New Technology: Introducing Python by Rolf André Klaedtke and Bruce Eckel on Page 14 PowerSurvey Results by Mark Lansing on Page 16 PowerTip: Non-Visual Object Instances in PB 7 by Werner Warger on Page 17 Little Helpers: Table Dancer 1.12 from Helmar G. Dahmer reviewed by Arthur Hefti on Page 20 User Group Section on Page 21 Continued on page 2 SYBASE TECHWAVE 2000 by Rolf André Klaedtke About 3 weeks ago, I finally reserved my flight to Orlando for this year’s Sybase TechWave 2000 conference. This will be my 6th year at the conference. The first one that I attended was the one in 1995, also in Orlando. At the same time, it was my first trip to the USA. After the conference we went on a one-month trip through the USA: starting in Orlando, followed by New Orleans, an impressive trip through some National Parks in the SouthWest, and then we arrived in San Francisco, from where we went on a short trip through Northern California. The only bad deci- sion in that year was to go on a trip AFTER attending the conference, because I learnt so much that I wanted to ap- ply immediately... waiting a month travelling around was sometimes hard. But the trip was worth everything, it will be etched into my memory forever. Pictures of this and later trips will soon be up at my website at http:// www.raksoft.ch, if you’re interested. After the 2nd year in Orlando I was looking forward to the first conference out of Florida, to discover other places. Nashville in 1997 was impressive because of the incred- ible place were it was held, the conference in Los Angeles in 1998 was the worst of all attended and I first thought about not coming back. But then, I didn’t want to leave on a bad impression and decided to go back again in 1999. This was fortunate, I’ll admit, because last year was great. Orlando was still worth the trip, the ambiance was notice- ably better, Sybase seemed to be back on track. And in the past years I have made so many good friends that it was like a family get together, there was not a single annoying minute! This year I was convinced I would not attend for several reasons, but finally I was able to decide for the “GO” and

Upload: leo-vasquez-blas

Post on 26-Dec-2015

26 views

Category:

Documents


0 download

DESCRIPTION

APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

TRANSCRIPT

Page 1: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 1

MARCH/APRIL 2000 PRICE: US$ 7.50 VOL. 7 / ISSUE 2

JOURNAL FOR PEOPLE INTERESTED IN CLIENT/SERVER AND INTERNET

APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Contents

Editorial: Sybase TechWave 2000by Rolf André Klaedtke

Impressumon Page 2

The Vision:What’s in Store from Sybase in 2000 ?by Scott McReynolds on Page 3

Internet Aware: Internet-Aware PowerBuilderApplications, Part IIIby Roy Kiesler on Page 7

COM Knowledge: COM+ Securityby Alan J. Walsh on Page 10

New Technology:Introducing Pythonby Rolf André Klaedtke and Bruce Eckel on Page 14

PowerSurvey Resultsby Mark Lansing on Page 16

PowerTip:Non-Visual Object Instances in PB 7by Werner Warger on Page 17

Little Helpers:Table Dancer 1.12 from Helmar G. Dahmerreviewed by Arthur Hefti on Page 20

User Group Sectionon Page 21

Continued on page 2

SYBASE TECHWAVE 2000by Rolf André Klaedtke

About 3 weeks ago, I finally reserved my flight to Orlandofor this year’s Sybase TechWave 2000 conference. Thiswill be my 6th year at the conference. The first one that Iattended was the one in 1995, also in Orlando. At the sametime, it was my first trip to the USA. After the conferencewe went on a one-month trip through the USA: starting inOrlando, followed by New Orleans, an impressive tripthrough some National Parks in the SouthWest, and thenwe arrived in San Francisco, from where we went on ashort trip through Northern California. The only bad deci-sion in that year was to go on a trip AFTER attending theconference, because I learnt so much that I wanted to ap-ply immediately... waiting a month travelling around wassometimes hard. But the trip was worth everything, it willbe etched into my memory forever. Pictures of this andlater trips will soon be up at my website at http://www.raksoft.ch, if you’re interested.

After the 2nd year in Orlando I was looking forward to thefirst conference out of Florida, to discover other places.Nashville in 1997 was impressive because of the incred-ible place were it was held, the conference in Los Angelesin 1998 was the worst of all attended and I first thoughtabout not coming back. But then, I didn’t want to leave ona bad impression and decided to go back again in 1999.This was fortunate, I’ll admit, because last year was great.Orlando was still worth the trip, the ambiance was notice-ably better, Sybase seemed to be back on track. And in thepast years I have made so many good friends that it waslike a family get together, there was not a single annoyingminute!

This year I was convinced I would not attend for severalreasons, but finally I was able to decide for the “GO” and

Page 2: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 2

ImpressumPowerTimes is an international PowerBuilder Journal pub-lished 6 times a year mainly destined to PB User Groupsworldwide. If your User Group does not subscribe toPowerTimes and you would like to receive it, then you cansubscribe to it on an individual basis.

Contact addresses:Editor: Rolf André Klaedtke

Bächlistrasse 21CH-8280 Kreuzlingen / SwitzerlandFax: ++41 - (0)71 - 670 01 71e-mail: [email protected]

Co-Editor: Mark A. LansingEichmatt 17CH-6343 Rotkreuz / SwitzerlandFax: ++41 - (0)41 - 790 74 79e-mail: [email protected]

On the web: http://www.powertimes.com

Column responsibles:Little Helpers: Arthur Hefti

[email protected]

PFC Place: Boris [email protected]

Know How: Bernie [email protected]

COM Knowledge Alan [email protected]

EASy Does IT William B. [email protected]

Subscription rates:Individual: US$ 45 per yearUser Group: US$ 750 per year

For user group subscriptions, the group has the right todistribute PowerTimes to their members in an electronic orprinted form at no extra charge ! PowerTimes is producedas an electronic document in Adobe Acrobat format.

Disclaimer:Articles or opinions published in PowerTimes do not necessarilyreflect the opinion of the editorial team. They reflect the opinionof the submitter. We assume that the copyright of all submittedarticles is owned by or granted to the submitter. We must declineevery responsability regarding technical correctness or truth ofsubmitted articles and opinions.

I’m now looking forward to another exciting week inOrlando. After initially looking at the agenda I was disap-pointed that I would not be there, since there were morethan just a few sessions that I would have liked to attend.But I’m glad I’ll be there... what about you ? Have yousigned up ? The first deadline for the discounted registra-tion fee has passed, but it’s still cheaper to sign up nowthan a week before the begin of the event.

Is there a future for PowerTimes ?By the time TechWave 2000 starts, we should also be ableto give you some news about the future of PowerTimes. Itis a fact that PowerTimes has been growing in popularityand even though we have not been able to offer creditcard payment for subscriptions through our website fromthe end of last year, there are still people contacting us forsubscriptions.

The “bad” news for us is that some of our writers said thatthey needed a break, and it has become harder and harderto find people willing to write for PowerTimes. Unfortu-nately there were some who have promised to write for us,but never did... same problem with those who subscribedto PowerTimes but never paid their invoice. Of course,they don’t receive PowerTimes, but all this combined is alot of work and stress for us, who still do this in our “sparetime”.

It’s a while ago now, since we really reached the pointwhere we had to decide whether to stop publishingPowerTimes or to grow it into a “real” business, with peo-ple who take care of getting advertisements and subscrip-tions on a professional level to finance the whole adven-ture, administer the subscription base, the accounting andhelping in the production cycle and all the other tasks.

Finally, some time ago and to our big surprise, we receivedan e-mail from a company who was interested in takingover PowerTimes, at the condition that both Mark Lansingand myself would stay on board. Due to the reasons ex-plained earlier, we took up the discussion and hopefullyby the time of the conference we can tell you more aboutit. Anything is possible at this point...

This is the reason why we have taken away the possibilityto subscribe to PowerTimes past issue 7/3. At this pointwe don’t know who will own PowerTimes or whether itwill exist at all. So, if you always wanted to write an arti-cle for publication in PowerTimes, now it’s definitely theright time!

Nevertheless, we would like to thank all our readers, au-thors and advertisers for their support and hope you willenjoy reading this issue. Thanks to those of you who sendus your feedback, there have been some very nice mes-sages.

Rolf André KlaedtkeMark LansingEditors

Page 3: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 3

IntroductionThe Internet Application Division at Sybase has a verybroad vision for the year 2000. This year we will be add-ing a number of great new features to our products to im-prove the developer’s environment and productivity. Wewill be issuing new releases of the majority of our prod-ucts this year, and in this article I would like to introduceyou to the new features in order of delivery.

EAServer 3.6The first product that will be released in 2000 will be ver-sion 3.6 of EAServer. This version is targeted for our JavaDevelopers. It will provide all of the major functionalityfor J2EE. The functionality that will be included in thisrelease is:

• Support for Enterprise Java Beans (EJB) at the 1.1specification level. EAServer 3.5 began EAServer’ssupport of EJBs. This release will include the supportof Container Managed Persistence (CMP) as well asthe XML deployment descriptors.

• JavaMail functionality will also be added to the server.The intent of JavaMail is for a platform and protocolindependent framework to build Java-based mail andmessaging applications. The release that is includedin EAServer will allow users to send mail as well asuse the XML Deployment.

• Servlet support at the 2.2 specification level. Servlet2.2 adds the support for the packaging and deploy-ment of web applications, either standalone or as partof a J2EE application. Servlet 2.2 also addresses se-curity, both standalone and within the J2EE platform,and it provides support for the notion of a Web Appli-cation.

• Java Server Pages (JSP) allows for creation of webpages with Dynamic content. They have HTML-liketags for the inclusion of scriptlets. These scriptlets,written in Java, encapsulate logic that generates ei-ther page content or the data on the page. Developerscan use standard HTML for formatting and page de-sign. As pages are called they are compiled and be-come servlets that run inside of the server container.JSPs can be used to generate HTML pages or XMLdocuments. JSPs will be supported at the 1.1 specifi-cation level.

• The addition of a Message Service. The message serv-ice provides queues for message consumers, and al-lows message producers to send messages to speci-

WHAT’S IN STORE FROM SYBASE IN 2000?by Scott McReynolds, Sybase

fied queues (point-to-point messaging), or to publishmessages with specified topics that may be of interestto registered consumers (publish/subscribemessaging). Messages that are sent or published canbe stored in memory or in a database until they can bedelivered. The message service provides a pull-stylemechanism for client notification and a push-stylemechanism for component notification.

• Some additional security features will be added aswell. These features include additional basic authen-tication. Basic authentication is the same as httpusername and password authentication. In this case,the browser can pop up a dialog asking for theusername and password. Form authentication will alsobe added. Form authentication is when a web appli-cation can set-up a customized form for authentica-tion purposes. The last security enhancement plannedfor this release is SSL certification authentication. Thisrequires the user to use a SSL session and a clientcertificate.

• The addition of support for Enterprise Archive (EAR)and Web Archive (WAR) deployment will be addedto the server.

As a liscensee of J2EE, Sybase is very excited to have allof the functionality in the 3.6 release.

Future releases of EAServer will add business-to-businessfeatures, an emphasis on high availability, persistence andcaching. Specific features that will be included in the re-lease to support these objectives include JDMK, Jini, fullJMS implementation, Hotspot and MessageBroker inte-gration.

PowerJ 3.6Features for PowerJ will follow a number of those ofEAServer. For PowerJ 3.6 they will include:• Target migration of EJB 1.0 objects to the EJB 1.1

specification. This will automatically update the de-ployment descriptors as well as create a new targetbased on the original. This migration will save theoriginal target in case it is currently being used in pro-duction.

• A number of EJB 1.1 class and helper class changeswill also be incorporated. These include such thingsas changing of Exception and Finder types to supportthe 1.1 specification.

Page 4: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 4

• Developers will be able to debug servlets just likeEJBs can be debugged today. This will improve de-veloper productivity and decrease the developmenttime required for servlets.

• For JSPs, PowerJ will allow HTML and JSP Editing.The PowerJ editor will highlight HTML and be JSP-aware to improve developer productivity. One of themost difficult things to deal with when developingJSPs is finding syntax errors quickly and easily.PowerJ will allow developers to do design time syn-tax checking of their JSP objects. At build time thecompiler will compile the JSP and verify it, notifyingthe developer of any errors the compiler finds. De-velopers will also be able to do Server-Side Debug-ging of the JSP objects. In order improve the speed ofthe JSP’s execution, at deployment time the JSP willbe implemented as a servlet thus eliminating the needto compile the JSP the first time it is called.. PowerJwill also create the WAR file entries as needed to sup-port the JSP.

Future releases of PowerJ will provide an improved MDIdevelopment environment. This is to address developer’srequests to minimize the number of windows open whenworking within PowerJ. We will also be adding PowerSiteintegration within PowerJ. This will provide PowerJ withthe ability to create web pages and development and de-ployment from within the PowerJ environment.

PowerBuilderPowerBuilder continues to stay current with new applica-tion development technologies for the purpose of allow-ing developers to leverage their PowerBuilder skills fordistributed and web applications. Just as PowerBuilderoffers a 4GL approach to traditional Windows applicationdevelopment, the next release will offer a 4GL-like expe-rience for web development. To address the web require-ments for today’s applications, PowerBuilder has directlyincorporated web technology from PowerSite.

To effectively use features from PowerSite withinPowerBuilder, it is important that PowerBuilder be ableto work with more than one target application at a time.Two new concepts are introduced into the PowerBuilderdevelopment environment - workspaces and targets. Theworkspace is responsible for holding all of the applica-tions and components that are going to be used for devel-opment. Targets are used to represent those applicationsand components. By introducing a new web target con-cept, PowerBuilder will be able to build, manage, and de-ploy HTML files, images, and other assets that comprise aweb site.

In addition, a new server-side object model for buildingweb applications will provide the infrastructure to allowpage development with PowerBuilder to be based on anevent driven architecture, which is much more productivethan traditional procedural web development. Server-sideevent scripts will be available and can be coded just likeclient side event scripts.

Integration with Enterprise Application Server (EAServer)was greatly enhanced with the release of PowerBuilder7.0. The next major release of PowerBuilder will continuethis trend and offer a very compelling and productive plat-form for the development and deployment of distributedand web applications.

Internationalization is now built into the core ofPowerBuilder by featuring full Double Byte Character Setsupport for environments that may have DBCS support asa requirement.

Additional database support is typical of a newPowerBuilder release, and the next release is no excep-tion. Sybase Adaptive Server Enterprise 12, Oracle 8i andJDBC 2.0 are all supported.

No version of PowerBuilder would be complete withoutincorporating the enhancement feedback and new featurerequests from the PowerBuilder community. With the as-sistance of the International Sybase User Group, new fea-ture enhancements were selected and incorporated intowhat may prove one of the most exciting releases thePowerBuilder community has yet to experience.

PowerDesignerFor PowerDesigner, Sybase is trying to provide Synergywith other IAD products. They include plans for applica-tion development integration. The main focus if this inte-gration is on EAServer for the purpose of developing newWeb applications. The overall product goal is to simplifyobject-oriented, component-based, multi-tier web appli-cation development and deployment through analysis anddesign. To meet these goals Sybase has planned a numberof enhancements. These enhancements include:

• The auto-generation of test data into a designed data-base. This is to reduce the development time be pro-viding data which can be easily placed into a newlydeveloped datamodel.

• A mechanism to help database administrators com-pute their designed database size.

• The generation of XML files from a class diagram.This generation includes both the generation of XMLSchema as well as XML Data. It should be noted thatwith XML file recovery, an XML document can beimported into a class diagram.

• A number of Repository changes. These include us-ing the same architecture as MetaWorks uses for stor-ing the repository. This will provide one integratedrepository for all of the PowerDesigner products. Wewill also be adding support of ASA and other ODBC-compatible RDBMS for the repository’s persistencedatabase. Sybase will also be adding repository envi-ronment administration and management (accessrights, etc.) to the modeling environment. This willprovide a much more secure modeling environment.Modelers will also be able to consolidation into therepository’s database as well as extract from this sameenvironment. They will also be able to version their

Rolf A Klaedtke
Rolf A Klaedtke
Page 5: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 5

models so they can rollback to pervious versions ifneeded. Along with this versioning they will be ableto compare model versions to find what had changedbetween them.

• Design and implementation of server-side logic. Thislogic can be then output in an EJB format as eitherbean or container managed persistence. To help sup-port this, PowerDesigner will be integrated withPowerJ to allow the designer and developer to workseamlessly together.

As you can see from the new features, Sybase has a numberof very exciting plans for it’s development community!Watch this space!

?Scott McReynolds has worked in the data processing in-dustry for over 15 years. He has been with Sybase for 41/2 years where he is Senior Product Line Specialist.You may contact him at [email protected].

PowerTimes is a leading development journal for Sybase tools.Published in Switzerland, thousands of developers around the world already enjoy this publication.

If you want to find out more, or download a free copy, visit our web site - you won’t regret it.

Page 6: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 6

Page 7: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 7

INTERNET-AWARE POWERBUILDER APPLICATIONS: PART IIIby Roy Kiesler

IntroductionAt the end of my previous article, we left John, a seniorPowerBuilder developer with VaporWare Inc. (previouslyACME Network Products Corporation,) sitting comfort-ably in his office chair with his feet up on his desk. Thefunction that John has written to convert the contents of adatastore to XML was working as designed; sales reportswere converted to XML file and uploaded to VaporWare’sFTP site. Life was good…

One day, John’s new development manager presented himwith a new requirement; all of ITOS’ reports needed to beexportable into XML format. A quick inventory of the re-ports table made it clear to John that coding some 300XML conversion functions would take too long. It wasevident that a new, more generic solution is required.

After an extensive analysis and re-design session (read 5minutes), John decided to modify his report file functiononce again. This time, the name of the DataWindow ob-ject to use for retrieval is passed as a function argument.The new version of the function looked like the following:

// Function of_CreateFile( long emp_id )// ——————————————————// Note: error handling code trimmed for// purpose of this article// ——————————————————

Datastore lds_xmlLong ll_rows, ll_cols, j, kString ls_filename, ls_path, ls_xmlInteger li_rc

lds_xml = CREATE Datastorelds_xml.dataobject = as_dataobjectlds_xml.SetTransObject( SQLCA )

ll_rows = lds_xml.Retrieve()ll_cols = lds_xml.Datawindow.Column.Count

IF ll_rows > 0 THEN li_rc = GetFileSaveName( & “Select File”, ls_path, & ls_filename, “TXT”, & “Text Files (*.TXT), *.TXT” )

IF li_rc = 1 THEN // XML header line ls_xml = “<?xml version=’1.0'?>”

// Outer entity - data ls_xml += “<data>”

// Row entities FOR j = 1 TO ll_rows

ls_xml += “<row>~r~n” // Column entities FOR k = 1 TO ll_cols ls_xml += ( “<“ + & lds_xml.Describe( “#” + & String( k ) + “.Name” ) + & “>” + String( & lds_data.object.data[j,k] ) + “</” + lds_xml.Describe( & “#” + String( k ) + “.Name” ) + “>” + “>~r~n” ) NEXT

// Close row entity ls_xml += “</row>~r~n”

NEXT END IF

// File creation and writing code was // trimmed for purpose of this article

END IF

Welcome to Hack CityAfter a few rounds of user testing, John quickly realizedthat his initial solution was not quite as generic as he hadenvisioned it. For one, he did not take retrieval argumentsinto account; the ITOS reports had anywhere between zero(0) and fifteen (15) retrieval arguments.

After a few futile attempts at exporting DataWindows andparsing their syntax to extract the retrieval arguments, Johndecided to go back to the drawing board… (yes, I knowthe PFC Report Service uses this method, but this is a crudeand not-so-slick method.)

Rather than implementing a client-side solution, John de-cided to delegate the XML generation task to a server proc-ess, which would offer faster processing and utilize lessresources.

PowerDynamo to the RescuePowerDynamo is Sybase’s best-kept secret. At its simplestform, PowerDynamo is a dynamic Web page server, but infact, Dynamo is much more than that. Unfortunately, inorder to limit the scope of this article, I will only focus onone of Dynamo’s slew of features – XML support.

PowerDynamo provides several tools for working withXML:

Page 8: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 8

• Functions and tags that let you create database que-ries and provide their output to a Web browser in XMLform

• Functions to parse XML documents and access indi-vidual pieces of a parsed document

• A set of objects to create and modify XML documents

A simple Dynamo XML template looks like the following:

<?xml version=”1.0"?><!—SQL

SELECT product.prod_id, product.prod_num,product.name, os.name, product.priceFROM DBA.product product, DBA.os osWHERE product.os_id = os.os_idORDER BY product.prod_id

—>

<data>

<!—formatting—><row><id><!—data—></id><num><!—data—></num><name><!—data—></name><os><!—data—></os><price><!—data—></price></row><!—/formatting—></data>

To invoke this XML query, we type the following URLinto our browser’s address field:

http://servername/products.stm

The results of this query will be displayed in the browseras follows:

<?xml version=”1.0" ?>

<data>

<row>

<id>120</id> <num>P60542</num> <name>EAStudio 3.5</name> <os>Windows NT</os> <price>3445.00</price>

</row>

<row>

<id>121</id> <num>P60543</num> <name>EAStudio 3.5</name> <os>Solaris</os> <price>3445.00</price>

</row>

<row>

<id>122</id> <num>P60546</num> <name>EAStudio 3.5 Doc. Set/name> <os>Windows NT</os>

<price>249.00</price>

</row>

</data>

XML and DynaScriptJohn’s final solution was to construct a Dynamo templatethat executes a SQL statement (passed as a URL page pa-rameter) and returns the result set in XML form. The tem-plate source code is shown below:

<?xml version=”1.0"?>

<data>

<!—SCRIPT

var sqlString = document.value.sql; var rs = connection.CreateQuery( sqlString );

if ( rs.GetErrorCode() == 0 )

{

var nRows= rs.GetRowCount(); var nCols= rs.GetColumnCount();

if ( nRows > 0 ) { // start top level element

document.writeln( “<data>” );

// for each row ... for ( j = 1; j <= nRows; j++ ) { if ( rs.MoveNext() ) { document.writeln( “<row>” ); // ...write each column’s // name and value for ( k = 1; k <= nCols; k++ ) { colName = rs.GetColumnLabel(k); document.writeln( “<“ + colName + “>” + rs.GetValue(k) + “</” + colName + “>” ); }

document.writeln( “</row>\n” ); } } } } else document.writeln( “<error></error>” );—></data>

To invoke this XML template, we simply type the follow-ing URL into our browser’s address field:

http://servername/sql2xml.stm?sql=select * fromsales_order_items order by id, line_id

Page 9: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 9

The results of this query will be displayed in the browseras follows:

<?xml version=”1.0" ?>

<data>

<row>

<id>2001</id> <line_id>1</line_id> <prod_id>300</prod_id> <quantity>12</quantity> <ship_date>1996-09-15</ship_date>

</row>

<row>

<id>2001</id> <line_id>2</line_id> <prod_id>301</prod_id> <quantity>12</quantity> <ship_date>1996-09-14</ship_date>

</row>

<row>

<id>2001</id> <line_id>3</line_id> <prod_id>302</prod_id> <quantity>12</quantity> <ship_date>1996-09-14</ship_date>

</row>

</data>

Utopia? NotWake up! ITOS is not one of those snazzy Web applica-tions – it is an ageing, Client/Server, PowerBuilder 6.5application, remember? How, then, can a PowerBuilderapplication harness the power of a dynamic web pageserver?

The answer lies in yet another hidden PowerScript gem –the PostURL PowerScript function. This function performsan HTTP Post, allowing a PowerBuilder application tosend a page request to a web server.

The following code uses the SQLPreview DataWindowevent to capture the SQL statement of the report, but in-stead of retrieving it, it sends it as a parameter to an HTTPrequest, where it will be picked up by the sql2xml.stmPowerDynamo template:

Blob lblb_argsString ls_headers, ls_urlLong ll_length

// ir_xml is a standard class inherited// from InternetResultir_xml iir_xml

// inet_xml is a standard class inherited// from Inetinet_xml iinet_base

iinet_xml = CREATE inet_xmliir_xml = CREATE ir_xml

ls_url = “http://localhost/xml/”ls_url += “sql2xml.stm?”

lblb_args = Blob( “sql=” + sqlsyntax )ll_length = Len( lblb_args )ls_headers = “Content-Length: “ + & String( ll_length ) + “~n~n”

iinet_xml.PostURL( ls_url, lblb_args, & ls_headers, iir_xml )

The ir_xml object, which inherits from the InternetResultstandard class, implements a single function calledInternetData, whose argument is a blob containing thereturned HTML from the Web server. For the purpose ofthis article, this function has only two lines:

MessageBox( “XML Output”, String(data) )

RETURN 1

In a production environment, this function would mostlikely write the XML to a file.

ConclusionXML is quickly becoming the de-facto standard of Internetdata communications, not only between Web browsers andservers, but also between any two computers or applica-tions.

At this point in time, it is still unclear if, when and in whatways PowerBuilder will support XML. Personally, I thinkthat the nature of the DataWindow perfectly lends itself toXML implementation – just look at a DataWindow exportfile; it is nothing but an ordered collection of attributesand values. Imagine how easy it would be to obtain aDataWindow’s retrieval argument if all you had to do istraverse a tree (XML DOM)…

Sybase has made a commitment to the XML standard. TheXML features in PowerDynamo are rich and flexible, andas the standard further matures, I’m confident it will findits way into PowerBuilder.

?Roy Kiesler is a Senior Lead Con-sultant at Noblestar Systems inCambridge, MA, an e-businesssolutions company embracingmeasurable results. Roy has beenworking with PowerBuilder sinceversion 4.0, developing client/server, distributed and Web appli-cations for the Pharmaceutical,Financial Services and Tele-com-munications industries. He is a

member of TeamSybase, a group of highly proficientSybase/Powersoft product users, who volunteer theirtime to answer questions in various support forums.Contact Roy via e-mail at [email protected].

Page 10: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 10

COM+ SECURITY

by Alan J. Walsh

IntroductionNow that Windows 2000 is finally here I thought it mightbe useful for me to devote some time to discussing thenew features of COM+ in detail. Some of you will recallthat I gave a preview of these features in an article lastyear, but that was based on a release candidate and somethings have changed since then. For one thing not all ofthose features made it into the final release of Windows2000! But most did, and I think it would be interesting todo some in depth analysis of those features now. I’ll startthings off with this article and a subject that many devel-opers dread but nevertheless must face sooner or later –security.

The Problem of SecurityIf you are like me then security is not a topic that reallyexcites you. Developers work very hard to develop crea-tive systems, and often times security gets in the way ofthat. Either you have to work too hard during the develop-ment process to incorporate the requisite level of securityin your system, or worse yet you ignore security until thelast possible minute and then scramble to find a way toglue it on to your project. I’d rather be thinking about waysto solve business problems and let someone else write allthat nasty security code.

Fortunately, this is exactly what COM+ tries to do. COM+,and indeed the entire Windows platform, is all about em-powering developers with an environment that providesthe maximum amount of functionality with the least amountof unnecessary work. Windows provides a vast quantity ofservices to developers and increasingly those services areavailable without having to write very much code at all.COM+ security is one such service.

COM SecurityLet’s start by reviewing what we already know about secu-rity in COM. In “classic” COM, there are four fundamen-tal security settings: authentication, impersonation, accesspermissions, and launch permissions. These settings canbe applied on a machine-wide basis, and those settingsbecome the defaults for all components. You can alsoconfigure COM applications with their own settings. Ineither case you use a utility called DCOMCNFG. This utilitystill exists in Windows 2000 to provide this functionalityto COM applications.

Figure 1, DCOMCNFG

Launch permissions specify who is allowed to start com-ponents running on this particular machine. You simplyadd Windows accounts or groups to this list and specifyallow or deny for launch permissions.

Access permissions determine who is allowed to use a par-ticular component. As with launch permissions, this is sim-ply a list of Windows security principals with an allow ordeny flag. Be sure to include the SYSTEM account in thelist of allowed accounts.

Authentication level allows you to set a desired level ofencryption and authentication between the client and yourapplication. Table 1 lists the possible levels from least se-cure to most secure.

Be careful when tampering with authentication levels. COMnegotiates a level based upon the settings of the client andthe component. If they do not match an error will result.For example, your client can programmatically specify alevel that is lower than that of the component, and the callswill fail.

Impersonation allows you to control the degree to whichthe component can know the client’s identity, and whatthey can do with that knowledge. Again from least to great-est, in table 2 there are the possible impersonation levels.

As with authentication, clients can programmatically settheir impersonation level. If clients do not specify an im-personation level, the machine-wide setting will be usedby the component.

Page 11: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 11

Table 1, COM authentication levels

Table 2, Impersonation levels

One final COM security setting that has a large impact onhow your component will operate is identity. This deter-mines the security credentials under which your compo-nent will run. Figure 2 shows the available options.

Figure 2, Identity

Setting identity to the interactive user instructs COM tolaunch the component with the security credentials of who-ever happens to be logged in interactively. This has someobvious problems and is really only useful during debug-ging or an application that specifically needs to interactwith a logged on user. Selecting launching user causes thecomponent to be created with the caller’s identity. Youcan also choose to have the component launched under aspecific user account. The System option is for compo-nents that run as services.

By tweaking these settings in DCOMCNFG a developeror administrator can control who can access componentsand what kind of permissions those components will have.You can set specific values for each component or simplychoose to inherit the machine-wide settings. This is finefor our “legacy” COM components, but what about ournew COM+ code?

Component Services Everything we have talked about so far still exists in Win-dows 2000 to support COM applications, but there is ad-ditional functionality to enhance security for COM+ com-ponents. To begin with, we have a much more powerfultool for configuring security and other COM+ properties.As you can see in figure 3, the new Component Services

Page 12: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 12

console provides developers and administrators with a fa-miliar interface for managing COM+.

If you are not yet acquainted with MMC consoles youshould be. MMC 1.2 is built right into Windows 2000,and you’ll find a console to manage every aspect of yoursystem. The major event in COM+ is the merger betweenCOM and Microsoft Transaction Server (MTS), and se-curity is a big part of this. The Component Services con-sole should look very familiar to users of the MTS Ex-plorer under Windows NT. Using the explorer style inter-face you can drill down to manage multiple computers.Right-click on the Computers folder to add additionalmachines to your list. By right-clicking on a computer youcan bring up the default machine-wide settings for thatmachine. These settings are a mixture of the COM secu-rity settings that you would otherwise configure usingDCOMCNFG as well as some non-security related COM+settings, such as those for the Distributed TransactionCoordinator (DTC). That’s right, with MTS now foldedinto COM+, the DTC is part of the mix when configuringyour COM+ applications. Note that by right-clicking on acomputer you can also start and stop the DTC – a handyfeature when you are debugging.

Application SecurityAs you continue to drill down in the CS console, you’llsee icons for each of your COM+ applications. Even ifyou do not have any applications of your own you willinherit some default system applications from Windows.If you look in figure 3 you’ll see that I have applicationsrelated to IIS 5.0, which I happen to have installed on thismachine. If you click on the COM+ Applications folderyou will see icons for each of your applications in the rightpane of your console. As was the case in the MTS Ex-plorer, any active applications will be indicated by a re-volving icon. Note that the “active” X of MTS has beenreplaced by a “+” for COM+.

To access the security settings for an application, simplyright-click on that app and select properties. You’ll get ascreen like this one:

Figure 3, Component Services consoleFigure 4, Application Settings

We are most interested in the Security, Identity, and Acti-vation tabs. Activation is the best place to start because itdetermines a lot of our other choices. As was the case inMTS, you can choose to run your application either as aLibrary application or a Server application. Library appsare created in the caller’s process. Server apps are createdin a dedicated server process. If you look back at figure 3again you can see that I have applications for both in-proc-ess and out-of-process IIS applications.

The identity tab allows you to choose the identity of yourcomponent in much the same way we used to do underCOM with DCOMCNFG. The only choices here are Inter-active user or a specific user that you must choose. ForLibrary applications, the identity tab will be greyed out –library applications always run under the client’s identity.

The security tab that you see in figure 4 shows you thepossible security settings for a server application. You beginby choosing whether or not to enforce access checking.After that you can select between two security levels. Inthe first level access checks are only made at the processlevel. Note that this setting should be avoided for libraryapplications. The second security level allows you to turnon access checking at the component, interface, and methodlevel. Remember that at this point we are still justconfiguring the security for our application. The applica-tion in turn will contain one or more components, whichwe will discuss later.

In the bottom of the security tab for the application is adrop-down that allows you to select an authentication level.The choices here are the same as for COM applications.Finally you can select an impersonation level. The imper-sonation level specifies what the application wants to al-low when it is a client calling other applications. If youlook at a library application you will notice that the au-thentication and impersonation drop-downs are replacedwith a single check box that turns on or off authentication

Page 13: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 13

for the library’s host process. Now that you have configuredthe security settings for your application you can move onto more specific settings for the components that comprisethe application. But before we do that, we need to exploreanother key concept in COM+.

What’s My Role?Roles were introduced in MTS to allow developers andadministrators an easier way to configure security for com-ponents. Roles are categories of users that the developerdefines within the application for specific access levels.The developer creates roles and assigns those roles differ-ent access levels for applications, components, etc. Theadministrator’s job is to later fill in those roles or catego-ries with real user accounts. The beauty of this division oflabour is that the developer can configure security withouthaving to be aware of the actual users who will eventuallybe granted access through roles. You might for examplecreate a commercial application with roles like “Manager”and “Clerk.” You could then deliver that application toyour customers with a complete security configurationwithout having to know who will actually occupy thoseroles. All COM+ security is based on roles, so it is impor-tant to understand this concept as you develop your appli-cation. You need to consider which roles your applicationwill have and what objects each role will have access to. Itwill have a direct impact on everything right down to themethods that you choose to create.

Getting back to our Component Services console, we cansee how this role-based security works. As you drill downbelow the application level you will see two folders: onefor the components that make up your application and an-other for the roles. You can create new roles by right-click-ing on the Roles folder and selecting New. Administratorscan then use this interface to assign users to the role. Right-clicking on a component and selecting Properties bringsup the dialog in Figure 5.

You can enable or disable access checking at this leveland below by checking the authorization checkbox. Thisallows you to enable access checking for components atthe application level and then to selectively enable accesschecking for each individual component. The bottom partof this dialog allows you to specify which roles will haveaccess to this component.

As you continue to drill down to the interface and even themethod level you will see that they each have a securitytab on their property dialogs that also allows you to assignaccess permissions to your application’s roles. Roles thatyou assign at higher levels are inherited by objects belowthem.

Scripting and ProgrammingWith all these possibilities you might start to get anxiouswhen you think about configuring security for a compli-cated application with many components and methods.Fortunately, everything that you can do in the CS consolecan also be scripted. The Windows Script Host is builtinto Windows 2000, so both developers and administra-tors can write scripts to manage complex applications andlarge numbers of servers.

Another very important point is that all of the features ofCOM+ security are available to both clients and servers inapplication code. Everything from authentication to rolescan be accessed through the COM+ API. A complete dis-cussion of this API is beyond the scope of this article, butyou can find complete documentation in the Platform SDK.Of course choosing to implement security in code defeatsour goal of simplifying the security process. Before youstart writing a lot of security code by hand, ask yourselfthis question: does COM+ already do this for me?

ConclusionThe new Component Services console and the incorpora-tion of MTS features like roles really simplifies the life ofboth COM+ developers and administrators. The goal ofCOM+ is to provide a system in which developers canfocus on writing business logic, and then choose to incor-porate services like security or transactions later when theyconfigure their components. Security will always be a partof the development process, but COM+ shows that itdoesn’t always have to be the worst part.

Figure 5, Component security settings

?Alan Walsh works for In-diana University.He can be reached [email protected].

This is Alan after his pres-entation on COM at theSwiss PB User GroupMeeting in Zurich, Nov. 98.

Page 14: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 14

IntroductionAnd now for something completely different...

Back in April of this year, I organized a Hands-on JavaSeminar with the well-known author of the book “Think-ing in Java”, Bruce Eckel. The week was very interesting,not only because of the seminar itself, but also because wehad a small and interesting group. During the seminar,Bruce kept mentioning a language called “Python”, whichwe had never heard of. Eventualy we “‘pressured” him totell us more about it.

This article is based on Bruce Eckel’s slides and extractsfrom two Python books that I have purchased since then.Yes, we were positively impressed, that’s why I thoughtI’ll introduce Python to those of you who don’t know ityet.

What is Python ?Python is an object-oriented language for writingstandalone programs, scripts and prototypes of complexapplications. One of the nice things about Python is that itis free: if you haven’t heard about it, than it’s probablybecause it’s open source and there’s no big marketingmachine (or a single company with a big marketing budget)pushing it. It’s a a “grass-roots” movement, as Bruce likedto call it.

Python scripts are portable across many platforms, includ-ing all major Unix systems, Linux, Windows 95/98/NTand MacOS.

Apparently Python is widely used in the Unix and Linuxcommunities, but it has a clean interface to Windows too.For those interested in using Python under Windows, thebook “Python Programming on Win32” (ISBN 1-56592-621-8, O’Reilly) is a recommendable resource. On the backcover of this book, one can read the following: “Python isgrowing in popularity; based on download statistics, thereare now more than 400’000 people using Python and morethan 150’000 using Python on Windows. Use of the lan-guage has been growing at about 40% per year since 1995,and there is every reason to believe that growth will con-tinue”.

Of course, you may argue that much can be written onpaper and the publisher probably has a good reason to writepositive things about the language. Well, don’t take thepublisher’s word… maybe I should throw in some state-ments taken off Bruce Eckel’s presentation given to usduring the Java Seminar.

INTRODUCING PYTHON

by Rolf André Klaedtke, based on material from Bruce Eckel

Why Python?According to Bruce, Python allows for a huge increase inproductivity. It is a good companion to C++ and especiallyto Java, and is completely free: that really means no royal-ties, no license agreement, but you can include it in a for-profit product or use it in your company without approvalfrom purchasing.

The book “Python Programming onWin32” provides some explanation asto where Python fits in the developmentpicture. The authors particularly rec-ommend Python as:

• A macro language• A rapid prototyping tool for object models and algo-

rithms• A testing tool• Data cleaning and transformation• Python as glue: this probably needs some explana-

tion: Python works well with files, network protocols,DLLs, and COM objects and it offers extensive li-braries to help accessing almost any kind of data. It’swell suited to controlling other packages, for system-administration tasks, and controlling the flow of databetween systems

The BasicsPython, like Java, is a compiled à interpreted language.It is “weakly typed” and you get templates without tem-plates. It is like Smalltalk, but with a much more C/C++/Java-like syntax, real OOP from the ground up. Functionshave regular argument lists and there’s no special ‘$’ etc.in front of identifiers, so one doesn’t have to manage theargument passing. There are several quoting mechanismsand it’s easy to handle embedded sequences.

However, one of the biggest adjustments is the fact thatPython uses indenting for scope: this is shocking at first,but then, according to Bruce , it’s “…One of the greatestthings — you never have to parse braces and everybody’scode looks the same…”

Comparing the LanguageOn one of the slides, Bruce states that the previously men-tioned increase of productivity reaches the factor 10. Brucesays that this corresponds to his own experience and towhat he heard from others. In fact, he states that he would“…tackle problems that I wouldn’t even consider in C++

Page 15: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 15

or Java. I know it would take many hours or even dayswith those languages. Everything I do can now be ampli-fied with programming, instead of a few select tasks. It’sthe real promise of computing finally realized.”

To underline the above, he provides the following languagecomparison:

• In C++, I have to debug like mad• In Java, I have to type like mad

But not as much debugging because of garbage collec-tion, enforced exceptions, stronger type checking.

• Python is so expressive that I can write 1/10th thecode or even less than I have to in Java

Python provides Java’s checking benefits (possibly notso early in the development cycle, but at least thingscan’t slip completely through the cracks like in C++)and C++ templates for free, without having to learn thedifficult syntax and semantics.

Python manipulates symbols, so one gets the pre-proces-sor but with the complete power of Python. It also hasdefault arguments, named argument calls, and operatoroverloading

I never have to think about whether to make an argumentvirtual, or whether to do something different to a classbecause it might be multiply-inherited.

Pangloss as a Python programmer: “The best of all pos-sible worlds.”

So far Bruce Eckel’s words. But let’s look at some samplecode to give you a better idea. Sure enough, before writ-ing this article, I spent some time on the web to find morematerial on Python. Imagine my surprise when I found asample of how to use Python with PowerBuilder 5.0 !

Code samplesThe following code sends a mail message. There is a freemailing list manager available written in Python.

import smtplib, sys, rfc822

server= smtplib.SMTP(‘smtp.mail.com’)msg = “Subject: foo\nThis is a test”server.sendmail(‘[email protected]’, &‘[email protected]’, msg)server.quit()

The following code sample opens Word and prints the sen-tence “Python was here” in a new document:

from win32com.client.dynamic import DispatchWord = Dispatch(“Word.Application”)Word.Visible = 1WordDoc = Word.Documents.Add()WordRange = WordDoc.Range()WordRange.InsertAfter(‘Python was here’)

Of course, these samples are too small to really judge thelanguage and its possibilities. Therefore I’d recommendthat you download Python and have a look at it for your-self.

ResourcesFirst of all you can go to the Python website at http://www.python.org and download it. There you’ll also findlibraries, documentation and a lot of information.

If you haven’t heard of Python so far, you may be sur-prised by the number of books already available on themarket:

• Learning Python, by Lutz & Ascher, O’Reilly 1999• The Quick Python Book, by Harms & McDonald,

Manning 1999• Python Essential Reference, by Beazley, New Riders

1999• Python Programming on Win32, O’Reilly, 2000

These are just a few of them. I bought the first and the lastone on the list and can recommend both of them. I’d liketo add that among other material, the last one on the listprovides interesting introductions to COM/DCOM, NTservices and a lot more which already makes it worth buy-ing. Samples include how to integrate Python with Excelor how to work with E-mail, including a sample of how tosend a message with Exchange/Outlook.

There’s also a Python conference, for details seewww.Python.org (“Life’s better without braces”).

?Rolf André Klaedtke is an independant consultant andsoftware developer with over 15 years experience inthe IT industry, mainly working on the AS/400. He isthe publisher of PowerTimes and president of theSybase and PowerBuilder User Group Switzerland. In1996 and 1997 he has been the main organizer of theSwiss PB Conference. You can reach him [email protected].

Bruce Eckel is the author of“Thinking in Java”, “Thinking inC++”, and “C++ Inside & Out”.He has given hundreds of presen-tations throughout the world, pub-lished over 150 articles in numer-ous magazines, was a foundingmember of the ANSI/ISO C++committee, speaks regularly at

conferences and is the C++ & Java track chair for theSoftware Development conference. He provides pub-lic and private seminars & design consulting in C++and Java. Check out his website at http://www.mindview.com for more information.

Page 16: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 16

IntroductionIn the first quarter of this year we ran a survey asking foryour feedback on what you liked or disliked aboutPowerTimes, what we should concentrate on, what articlesubjects you were looking for, etc.

Although the response was not overwhelming, there wassome very useful information provided, and we appreci-ate that very much. This article will summarize the re-sponses to many of the questions we asked.

But first…we announced that there would be two luckywinners from the survey participants who would be re-ceiving special Swiss gifts. We are pleased to announcethat Bob Carlton from the U.S.A. and Kaoru Kishimotofrom Brazil were ‘drawn from the hat’. Well done guys,and thanks for your input!

The ResultsOne of the key points we wanted to know was whether ornot we should continue focussing only on the Sybasetoolset. A whopping 78% said “yes”, so that was clear. Wealso wanted to know whether or not the quality ofPowerTimes, including the articles, met your expectations.An amazing 98% thought that it did. This made us feelreally good - all the late nights have seemingly been worthit! Many people also commented on the excellent qualityof articles. As the editors, we can only take our hats off tothe authors in PowerTimes - they are really the people whohave made PowerTimes what it is, and we really couldn’tput PowerTimes together without them. The positive re-sults are a reflection of their hard work.

What You Liked MostWe also wanted to know what you liked most aboutPowerTimes, so we could continue to get it right. As al-ready mentioned, article quality was in fact the numberone item given here. The was followed by publishing in anelectronic format and that PowerTimes was rich in facts.

There were a couple of other items which people men-tioned which we just have to pass on: one person men-tioned the best thing about PowerTimes was the Editors(blush, blush). However, another thought the photos ofBoris Gasin were the best thing. No names will be men-tioned, but we’re sure many of you can guess who thiswas! And just so we can satisfy this person, and any oth-ers, again, here is Boris:

Boris Gasin - well liked

What You Liked LeastSo much for the good things. What don’t you like? Well,there was a tie for first place. Many said that they don’tlike the electronic format and the same number wanted tosee PowerTimes out more frequently.

Regarding the format issue, of those who expressed anopinion, there were actually a greater number who didn’tlike the electronic format than those who did. Unfortu-nately majority does not rule, and we are not about tochange. Sorry! As for frequency, if we could get enoughhigh quality articles we would certainly consider publish-ing more frequently, but over the years that has not beenthe case.

Some people thought there were not enough “quick-to-read” articles, others thought there was too much adver-tising (if only!) and others didn’t like the password pro-tection.

Articles, Articles, ArticlesWith articles being the most important feature ofPowerTimes, we asked what you wanted to read about. Atthe top of the list with 91% of respondants wasPowerBuilder.

OUR SURVEY SAYS…

Page 17: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 17

The top ten are:

PowerBuilder 91%New Technologies 73%PFC 60%Distributed PB 53%PowerJ 53%COM 51%Product reviews 40%PowerDesigner 38%EAServer 22%ASA 4%

Other TechnologiesWe also wanted to know about the technologies you wantedto read about. You told us that XML, CORBA and EJBwere the most interesting, followed closely by the web.There were not too many specifics about the latter one, sowe guess just about anything related to the topic would beinteresting.

You also noted that a discussion of techniques for devel-oping distributed applications would be handy, as well asinformation on thin-client development.

A few people mentioned that a column on new and emerg-ing technolgies would be useful, to keep readers up-to-date on what is happening.

In ConclusionYou certainly gave us some important feedback, but asevery technical publication, we need people to write aboutthe topics. Since there are not that many willing, timeshave become more difficult for us with every issue.

As mentioned in the editorial, we are currently in discus-sion with a company who would like to take overPowerTimes and increase its distribution as well as ensuresome regular article input. Even though there are a lot ofthings you want to read about, we will have to leave thesurvey results for now. We will hopefully soon be able toinform you about the future of PowerTimes.

IntroductionThis tip deals with non-visual objects that are declared asan instance variable in another object, and how this canbe done in PB 7.

As an example we will use a datastore to retrieve orderdata. To make it simpler the datawindow object has noretrieval arguments. We place that code in a window, butmore likely it would be in another non-visual object.

The PB 6 WayHow can we accomplish this in PB 6? The first thing is todefine an instance variable of type datastore:

Datastore ids_orders

After that we have do some coding to fill the datastore.Let’s say we do that coding in the open event of the win-dow:

ids_orders = Create datastoreids_orders.Dataobject = “d_orders”ids_orders.SetTransObject (SQLCA)ids_orders.Retrieve ()

NON-VISUAL OBJECT INSTANCES IN PB 7by Werner Wager

The PB 7 WayIn Powerbuilder 7 we are able to insert a non-visual objectinto another object in nearly the same way as we place avisual object on a window.

If you open the “Insert” menu item in the window painteryou have two options at the top: “control” and “object”.Inserting a control is just placing a control on the surfaceof window. Inserting an object is similar, but you don’t seeit on the window (of course, it is non-visual).

The cascading menu shows you all of the standard classobjects including “userobject”. What we do now to ac-complish our task is to select “datastore” from the menu.In the standard view the “non-visual object list” is dis-played as a tabpage in the right-hand lower pane. See fig-ure 1 below.

If you have a look at the pane above, the one that usuallyshows the properties of the window or controls, you seethat it shows the properties of the datastore. In figure 1,we have changed the default name, added the data objectand coded the data retrieval.

Page 18: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 18

Figure 1, DataStore properties in PB 7

And My Favorite Thing...Did you ever have the need to use a datastore and codesomething in an event of the datastore? Well I’ve had thatneed many times. Up to PB 6 you had to define a userobjectinherited from datastore, place the appropriate code in theuserobject and use that userobject instead of “datastore”.After a while you ended up with lots of “specialised”datastore objects that you could use only in one place.With PB 7 this is history. Just doubleclick the object inthe “Non-Visual Object List” and have a look at the scriptpane. All the pre-defined events of the datastore are there,ready to be coded by you. Simply put your code there andyou are done!

I like this approach very much. Finally you can “see” yournon-visual objects. But there is more to it... ?

Werner Warger is an IT consultant in Austria. He andhis company PowerSolutions have been concentrat-ing on Powerbuilder since PB3. You can reach Wernerat [email protected]

Page 19: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

a Client/Server and Internet development and consulting company

�����

Catsoft Development GmbH, Amdenerstr. 28a, CH-8872 WeesenTel: ++41 55 616 51 11, Fax ++41 616 51 14

Web: www.catsoft.ch, E-Mail: [email protected], Compuserve: CATsoftCH

�������� �� ��� �� ��� � �������

����������- Custom made Soft-

ware in any BusinessArea

�� � ��- For Sybase AG and

SQL AG

������ ��- On various Power-

Builder Topics

����������- Custom made Web Sites + Easy to maintain + Fast Development + Public Hosting available

������- ColdFusion- HomeSite- ScriptBuilder

����������- Custom made Web

Sites for Intranet andInternet usage

������- SilverStream Reseller

����������� �� ����������������� ����� � ������

Page 20: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 20

TABLEDANCER 1.12from Helmar Gordon Dahmer

reviewed by Arthur Hefti

IntroductionTableDancer is a command line utility that creates HTMLdocumentation from a SQL Anywhere or Adaptive ServerAnywhere database.

DescriptionTableDancer comes with an easy-to-use installation thatplaces all the needed files in a single directory (preferablyon a server that can be accessed from differentworkstations).

After the installation you have to define the database en-tries to work with in the TableDancer INI file. After doingthis all is set for using the tool.

Since TableDancer is a command line utility, it does nothave a GUI. If you are using the visible database engineyou can see how the database gets started and runs for acouple of seconds (it took about 20 seconds for 100 tableson a PIII/500).

Generated HTMLDuring the run the tool creates a lot of HTML files de-scribing your database. The documentation includes in-formation about Tables, Views, Procedures, Columns andtheir details, Primary and Foreign Keys, Indexes and eventhe number of rows in the table.

You can start browsing the database with an overview ofthe tables and views. By following the link on the tablename you get a table overview showing the number of

records, if it’s replicated, remarks and an overview of col-umns, keys, indexes, trigger information and eventually aperformance hint.

Each of these overview links opens a new page showingits details. As an example you can see here the perform-ance hint for this table.

TableDancer is primarily written for developers and DBadministrators that are used to working with ISQL, storedprocedures or embedded SQL.

In My OpinionTableDancer is an easy to use and quick way to have thelatest information about your data model right at your fin-ger tips. TableDancer can be run after some changes aredone to the database or could be included in the WindowsScheduler to update the information every hour or everyday.

Pricing, Availability and VersionsThe current version of TableDancer is Version 1 Release12. It is available for free from the following location:

http://www.softship.de/tabledancer.html

The author of TableDancer is Helmar Gordon Dahmer andhe can be contacted via email at: [email protected]

Page 21: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 21

PowerBuilder User Group Denmark

The members of the PowerBuilder User Group Den-mark receive PowerTimes thanks to a generous spon-sorship from Sybase Denmark.

Please contact Sybase Denmark, if you want to knowmore about the PB User Group Denmark:

Sybase Danmark A/SLyngbyvej 202100 Kobenhavn

http://www.sybase.dk

• The members of ANYPBUG are dedicated to the ad-vancement of their skills both professionally and techni-cally.

• ANYPBUG is a not-for-profit organization establishedas a forum to help members realize their goals.

• Through regular meetings and events, members learn thelatest techniques and trends surrounding thePowerBuilder product. Members also have a chance toview emerging technologies before they become promi-nent in the work place.

• Membership is free! Several forward thinking organiza-tions pay an annual fee to help support the activities ofANYPBUG.

Albany New York PowerBuilder User Group

President: Greg [email protected]

Vice President: Ed [email protected]

Treasurer: Danna [email protected]

Secretary: Steve [email protected]

ChicagoLand Sybase Tools User Group

The officers of the CPBUG are:

President Michael Baraz (630) 235-4529Vice-President Peter Vassilatos (312) 856-6720Secretary Jeff Barnes (847) 549-7765Treasurer Catherine Chang (630) 350-6048

The User Group meets the first Tuesday of each month(unless otherwise noted). Please check the websitewhich can be found at:

http://www.cpbug.org

The Secretary of the ChicagoLand PowerBuilder UserGroup, Jeff Barnes, can be reached at the following e-mail address: [email protected].

Page 22: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 22

PowerBuilder User Group Italia

Vogliamo ricordarea tutti gli utilizzatoridi Powerbuilder dilingua italiana chel’iscrizione alPowerbuilder UserGroup Italia e’Gratuita, basta soloregistrarsi sul nostroweb e si ha diritto a

partecipare ai forums in italiano dove scambiare ideesu Pb con altri utenti.

E-mail: [email protected]: 0331/700189Internet: http://www.telemacus.it/pbug/pbug.htm

The members of the PowerBuilder User Group Italy re-ceive PowerTimes thanks to a generous sponsorship fromSybase Italia.

L’ abbonamento a PowerTimes per gli iscritti del PowerBuilder User Group Italia e’ stato gentilmente offerto daSybase Italia.

Club Fibonacci - Club des Utilisateurs Sybase France

Le club francais des utilisateurs PowerBuilder n’existeplus en France. Il a été remplacé par le Club Fibonacci:le club des utilisateurs Sybase, qui est géré directementpar Sybase France.

Les membres du Club Fibonacci reçoivent PowerTimesgrace au sponsoring généreux de la société NOVALYS.

(The PowerBuilder User Group France doesn’t existeanymore. It has been replaced by the “Club Fibonacci”- the Sybase Users Group in France

The members of the Club Fibonacci (France) receivePowerTimes thanks to a generous sponsorship fromNovalys.).

NOVALYS met en place des outils,méthodes et normes dedéveloppement pour la réussite devos applications. Les consultants deNovalys accompagnent et certifient

vos projets pour garantir leur réussite technique.

NOVALYS creates, distributes and supports complemen-tary tools for PowerBuilder and is the distributor of HOWfrom Riverton Software in France.

Visit our website at: http://www.novalys.fr.

Novalys SA140 rue Galliéni92100 Boulogne-Billancourt / France

Tel : 01.46.99.66.20Fax: 01.46.99.08.92

The Central Ohio PowerBuilder Users Group meetsbi-monthly on even numbered months. Meetings usu-ally consist of a guest speaker, member demos, orproduct presentation and a discussion period.

Location: Bank One Offices 1111 Schrock Road, Columbus, OH

Refreshments: 6:00 - 6:15pm, Presentation: 6:15

Our mailing address is:Central Ohio PowerBuilder User GroupP.O. Box 363Worthington, OH 43085-0363

Internet: http://www.cmhpbug.com

Officers:President: Barry McDonald

[email protected]

Vice President: Todd [email protected]

Secretary: Earl [email protected]

Treasurer: Sudhir [email protected]

Central Ohio PowerBuilder User Group

Page 23: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 23

Ottawa PowerBuilder User Group

The Ottawa PowerBuilder User’s Group iscomposed of Ottawa-area Information Sys-tems professionals who are interested in stay-ing on the leading edge of Power-Builder and

client/server development.

The group meets on the 2nd Wednesday of each month,from September through May. At each meeting, a newand interesting topic is presented and discussion is en-couraged. These meetings are a great place to meet fel-low users, discuss issues and ideas, and network for fu-ture opportunities.

The Ottawa PowerBuilder User Group website can befound at http://www.opbug.com

President: Carole Hargrave [email protected]

VP Public Relations: Ron Guilbault [email protected]

VP Administration: Bill Stevens [email protected]

Treasurer: Wade Kornik [email protected]

Secretary: Paul Grawal

UK PowerBuilder User Group

An independent group formed in1992, PBUG currently has amembership approaching 150companies. Events are held threetimes each year with attendancesin the region of 200 at each event.The group is self-funding and re-ceives excellent technical support

from Sybase.

PBUG Council:

Chairman: Warren [email protected]

Treasurer: Ian [email protected]

Secretary: David [email protected]

Member: Brick Du [email protected]

The member council runs PBUG, but the day-to-day workis managed by Pb Associates.

Anne Bocock is responsible for most aspects of the groupincluding organising the conferences and putting togetherPBulletin. Judy Barnett handles all accounting matters.You can reach Anne and Judy at the PBUG office.

Telephone: 0181 421 3533Fax: 0181 420 1420Email: [email protected]: http://www.pbug.co.uk

Postal address:Suite A8, Kebbell HouseCarpenders ParkWatford, Herts. WD1 5BE

New Jersey PowerBuilder User Group

The President of the New Jersey PowerBuilder UserGroup, Guy Yasika, can be reached at the following e-mail address: [email protected]

The NJPBUG website can be found at:http://www.njpbug.org

The members of the New Jersey PowerBuilder UserGroup receive PowerTimes thanks to a generous spon-sorship from Dynamic Technology Group.

Dynamic Technology Group, Inc.1055 Parsippany Blvd., Suite 501-26Parsippany, NJ 07054

Phone:973.402.5600Fax: 973.402.5620

http://www.dynamictechgroup.com

Page 24: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 24

PowerBuilder User Group Norway

Formålet med vår brukerforening er todelt:1) Den skal være et kompetanseskapende forumfor brukere av Powersoft-produktene2) Den skal være et kontaktpunkt mellom brukereog Sybase Norge AS når det gjelder forslag tilendringer/forbedringer av produkter og relatertetjenester.

De fleste arrangementer i brukergruppens regi vilforegå på kveldstid. Arrangementene tar sikte på atman skal kunne utveksle erfaringer og kunnskapgjennom at brukere presenterer sine løsninger,

tredjepartsleverandører presenterer sine produkter,konsulenter viser prosjekter de har deltatt i etc. Nesteårs norske brukerkonferanse vil bli arrangert isamarbeid med Sybase Brukergruppe Norge.

Brukerforeningen vil også ha noen arrangementer isamarbeid med Sybase Norge AS slik sompresentasjoner av nye releaser o.l. Ønsker du merinformasjon om Powersoft Brukerforening Norge, takontakt med Thomas Revetal (Zema AS) på tlf. 90564 568.

Thomas Revetal Zema AS Tlf. 90 56 45 68Stig Melling SybaseRune Nerhagen WM-Data Tlf. 22 57 70 00Wenche Fronth Hærens Forsynings Kommando Tlf. 23 09 63 86Øystein Rolfsen De Norske Bokklubbene Tlf. 22 02 20 00Leif Aksel Grøthe Online Consulting Partner AS Tlf. 90 52 74 94

Oklahoma PowerBuilder User Group

We have regular monthly meeting on the First Wednes-day of every month.

President: Dianna DeMottoPhone: (405)360-3386Email: [email protected]

Vice President: William Walter

Secretary: Scott Chaney

Information on meetings can be found on our websiteat:

http://www.okcpbug.iwarp.com

The members of the Oklahoma PowerBuilder UserGroup receive PowerTimes thanks to a generous spon-sorship from Rattan Consulting from Oklahoma City.

Rattan Consulting is a Business Consulting com-pany.

We specialize in designing and programming custom win-dow based & internet applications. We have experiencewith EA Studio, EA Server, Powerbuilder, Visual Basicand C /C++. We also have staff specially trained and ex-perience in Data Warehousing.We are a Sybase Premier Partner and sell Sybase softwareat discounted rates so call us for all your software needs.

Rattan Consulting4334 NW Expressway Suite 259Oklahoma City, OK 73116

Phone:(405) 810-8005 Fax: (405)810-8097Email: [email protected]

Page 25: APPLICATION DEVELOPMENT WITH THE SYBASE TOOLSET

Page 25

Sybase and PowerBuilder User Group Switzerland

President: Rolf André [email protected]

Vice President: Andreas [email protected]

Treasurer: Martin [email protected]

Secretary: vacant

Member: Werner [email protected]

Internet: http://www.spbug.ch

The members of the Sybase and PowerBuilder UserGroup Switzerland receive PowerTimes thanks to a gen-erous sponsorship from CATsoft Development GmbH.

CATsoft Development GmbH is a Swiss Client/Server andInternet/Intranet company specializing on PowerBuilderand JAVA development. We have experience inPowerBuilder on the Internet (Web.PB), Powersoft’s PFCand HOW. We also do Cold Fusion and SilverStream.

CATsoft Development GmbHAmdenerstrasse 28aCH-8872 Weesen

Phone: +41-55-616 51 11Fax: +41-55-616 51 14Web: www.catsoft.ch

CATsoft

Toronto PowerBuilder User GroupSoftApproach Corporation is a software vendor. It offersPB Spy, a debugging tool for PFC-based PowerBuilderapplications. It helps you monitor your application proc-ess and view your data easily. Plus it can detect memoryleaks.

If you are interested in using PB Spy to promote youruser group activities, please contact:Paul Bis, President of the Toronto PowerBuilder UserGroup at [email protected]

For more information about the product, please check thefollowing website:

http://www.softapproach.com

President: Paul [email protected](416) 866-5493

Vice President: Ioana Naum

MembershipAdmin.: Debbie Brittain

Assistant: Haibo [email protected]

Assistant: Earl [email protected]

Assitant: Eugene [email protected]

The members of the Toronto PowerBuilder User Groupreceive PowerTimes thanks to a generous sponsorshipfrom SoftApproach Corporation.