Centura<strong>Pro</strong>Rally ’Round the FlagMark HunterWhere are the Americans? We werechatting about that at <strong>Pro</strong>Publishing recently. Historically,Centura Software has obtained about halfof its revenue from the United States andthe other half from international sales.Recently the international market hasgrown to more than half. But the“mindshare” market seems to belong, evenmore completely, to overseas customers.Please don’t misunderstand—<strong>Pro</strong>Publishing loves its international customersand authors! My personal experience is thatinternational customers speak out more and supportCentura Software more strongly than American customersdo. And a quick look at our authors (check our Web site)shows that most of them either live outside the U.S. orwere born outside the U.S. and now work here. EvenDavid Burke, our most prolific contributor, is Canadian.Without our international authors, Centura <strong>Pro</strong> would be amuch poorer newsletter, indeed.A lot of sophisticated applications exist in U.S.companies, and more are being written all the time. Thereare a lot of talented developers, too. Certainly there is nolack of material to write about. So, where are theAmericans? I invite them to “come out ofthe closet” and write about their favoriteCentura tips, tricks, and projects.The new stuffAnd, just in case anyone needs a hint: Ithink SQLBase 7 is an interesting milestonein Centura’s history. It’s obvious thatSQLBase is becoming more important, andthat Centura management believes theyhave a shot at getting it used by all kinds ofcustomers, not just those who use otherCentura tools. In my consulting career, mostof my clients have used backends other than SQLBase,even for relatively small databases. Should they be takinganother look at SQLBase? Let me know what you think.We’re also thinking about giving out a special awardto anyone who can describe, in clear language, whatnet.DB is, and what it does. Are you evaluating theproduct? What do you think? E-mail me and give me youropinion, anonymous or otherwise.Centura Team Developer 1.5, code-named “Eiger”, isin beta. We would love to know what you think of this,too. Is it as good an OLE client as you had hoped?Continues on page 3El Niño Mark Hunter, La Niña Dian Schaffhauser, Forecaster Shelley Doyle,Singin’ in the Rain Paul Gould, Weather Lab MochaCentura <strong>Pro</strong> (ISSN: 1093-2100) is published monthly(12 times per year) by <strong>Pro</strong> Publishing, PO Box 18288,Seattle, WA 98118–0288.POSTMASTER: Send address changes to Centura <strong>Pro</strong>,PO Box 18288, Seattle, WA 98118–0288.Copyright © 1998 by <strong>Pro</strong> Publishing. All rights reserved.No part of this periodical may be used or reproduced in anyfashion whatsoever (except in the case of brief quotationsembodied in critical articles and reviews) without the priorwritten consent of <strong>Pro</strong> Publishing. Printed in the United Statesof America.Centura <strong>Pro</strong> is a trademark of <strong>Pro</strong> Publishing. Other brand andproduct names are trademarks or registered trademarks oftheir respective holders.This publication is intended as a general guide. It coversa highly technical and complex subject and should not beused for making decisions concerning specific products orapplications. This publication is sold as is, without warrantyof any kind, either express or implied, respecting the contentsof this publication, including but not limited to impliedwarranties for the publication, performance, quality,merchantability, or fitness for any particular purpose.<strong>Pro</strong> Publishing, shall not be liable to the purchaser or anyother person or entity with respect to any liability, loss, ordamage caused or alleged to be caused directly or indirectlyby this publication. Articles published in Centura <strong>Pro</strong> reflectthe views of their authors; they may or may not reflect theview of <strong>Pro</strong> Publishing. Opinions expressed by CenturaSoftware employees are their own and do not necessarilyreflect the views of the company.Subscription information: To order, call <strong>Pro</strong> Publishing at206-722-0406. Cost of domestic subscriptions: 12 issues, $119;Canada: 12 issues, $129. Other countries: 12 issues, $139.Ask about source code disk pricing. Individual issues cost $15.All funds must be in U.S. currency.Call Centura Software Corp. at 650-596-3400.If you have questions, ideas for bribing authors, or would justlove to chat about what you’re doing with Centura products,contact us via one of the means at right.Talk to UsCentura <strong>Pro</strong> on the Webhttp://www.<strong>Pro</strong>Publishing.comEditorial DepartmentPhone: 818-249-1364Fax: 818-246-0487E-mail: mhunter@sprintmail.comSubscription ServicesPhone: 206-722-0406Fax: 206-760-9026E-mail: dschaffhauser@MCI2000.comMail<strong>Pro</strong> PublishingPO Box 18288Seattle, WA 98118-02882 Centura <strong>Pro</strong> May1998 http://www.<strong>Pro</strong>Publishing.com
A Java Client . . .Continued from page 1about them. For blobs, you just don’t use functions thatassume zero-termination (basically every SalStr* functionexcept SalStrSet/GetBufferLength). The ROB library forCTD allows you to use any kind of string, normal andblob; you just have to use it accordingly.In the Java client code I emulated CTD stringbehavior, appending a termination (“\0”) to outgoingmessages and truncating it from incoming messages.However, this simple approach would limit ROBfunctionality to regular strings; it wouldn’t work forblobs, because the message that arrives on the other sideof the connectionwould be differentfrom the startingone. The solutionwas to duplicate theset/get functions toadd their blobequivalents, wherethe termination isn’tFigure 1. The class structure.used.Passing references to functionsUsing SAL, like C, you can pass a primitive parameter byits reference (pointer) instead of its value. This iscommonly used in SAL to retrieve a string from a functionusing the return code to signal the success or failure of theoperation, since a null string itself could be a valid result.In Java you can’t pass primitives this way. The only thingsthat Java can pass by reference are objects. Actuallythey’re always passed by reference, like SAL does.This means that if you want to pass a string byreference, like I needed to do to rewrite the client code inJava, you’ll have to create a class that contains a stringand use objects created from that class instead of thestring itself. Since I had to use this class anyway, I alsoused it to fix the zero-terminated string problem. I createda class called __cROB_ReturnValue where I store thestring that comes from the ROB server and where thefunctions reside that extract a valid Java string, removingthe termination or the unmodified blob string.Class structureThe library (maybe I should call it “package,” as Javawould) is composed of three classes (see Figure 1):• _cROB_CommunicatorClient• _cROB_returnValue• ROB_Client(I didn’t use the “c” prefex for ROB_Client because ofJava’s naming conventions.)The __cROB_CommunicatorClient is responsible forthe connection procedures: It connects, disconnects, andsends and receives messages to and from the connectedROB server.The __cROB_ReturnValue class handles the incomingmessages. It stores theincoming value andinterprets the returncode and removes thezero termination, ifnecessary.ROB_Client is theactual class that you’llhave to use. It handlesall the services that aROB client needs inorder to access remote members and to execute remoteprocedures.ROB_Client references __cROB_CommunicatorClient(it’s a class variable), and both have an instanceconnection with __cROB_ReturnValue since they use it asa parameter.Java’s implementation of the WinsockUsing the Winsock in Java is enormously simpler thanusing it in any Windows development environment(unless, of course, you’re using some third-party library,OCX, VBX, DLL, or anything else between you and theWinsock). In Java you simply create a socket object fromthe Socket class, an input stream object and an outputstream object, bind everything together, and voila! itworks. You don’t have any blocking or non-blocking orsynchronous or asynchronous problems. Everythingworks; after all, Java was primarily developed fornetworking operations.Rally ’Round . . .Continued from page 2Happy talk from Wall StreetCentura has faxed out reprints of an article that ran in theMarch 4th issue of the Wall Street Journal, which notedthat new management has fixed many of the fundamentalfinancial problems that had been plaguing the company.They indicate that the stock may be worth looking at for aspeculative purchase. What do you think? I’d be interestedin the opinions of some long-term Centura investors. CPhttp://www.<strong>Pro</strong>Publishing.comCentura <strong>Pro</strong> May 1998 3