SyBase EnterPrise Application Server Novice on the road
Sybase Easerver also has a few articles that rarely mention some of the details of development. I engaged in jaguarcts development soon, encountered a lot of details, think just engaged in jaguarcts developers will encounter, to do the reference, another heart there are many problems, so this article, to start a discussion of the effect, Hope Jaguarcts Master can be, deep thank you.
First, the system configuration part:
1. Operating Environment:
WIN2000 Server Edition, SP2 patch, p3850cpu,pb8.0beta+easerver3.6.1.
2, the operation of environmental installation considerations:
Jaguarcts servers in the development environment do not install NT services, because the Jaguarcts component is frequently modified in development, and an "OBJECT can ' T SAVE" error, if not NT service, is used Jaguar Server (DEBUG). Restart J Aguar Server (Debug) After this type of error occurs. If you install an NT service, you can remove it using the following instructions:
ServerStart Servicename-remove (Serivename is the service name of Jaguar in NT service)
WIN2000 Server version must be patched, in fact, SP1 can also, otherwise can not generate proxy (proxy).
3, start Jaguar Manager (Figure (i))
(A) Jaguarmagager menu tool\connect\ Jaguar Manager.
(B) Point Profile Manager can add a profile.
(C) Enter Jagadmin (System) in user Name
(D) password defaults to null.
(E) Host name can be localhost. (If you have some experience, it can be changed to your machine name, but after the success of Connect to go in to modify the host name of each port in the listener.) )
4. Start the Security Manager (Figure (ii))
(A) Jaguarmanager menu Tool\connect ecurity Manager.
(B) The pin default password is "SYBASE"
5, modify the jagadmin password
(A) When the 3 connection is successful, double-click the servers in Jaguarmanager to display all current services, select a service and right-click, and in the right-click menu, select Server property to open the Properties panel.
(B) Select Security in the property panel to change the password.
6, manage the connection buffer
(a) Double-click Servers in Jaguarmanager to select a server in the list.
(B) Selection of install Connection caches
(C) Right click on the pop-up menu "Create and Install a New Connection Cache"
(D) Enter the connection cache name in the pop-up window.
(E) entered the connection cache configuration panel after the confirmation.
(F) This article takes the example of configuring SQL Server. In the General tab, configure: Server name is the service name of SQL Server. User name is the username to log on to SQL Server, enter password. In the Driver tab, select Odbc,dll OR CLASS NAME as ODBC32.DLL. Ping it and try it.
(G) If Ping does not work, you will have to look at the hostname you have entered before (3) of this article, if the localhost does not work, change to your machine name.
Second, the development of application parts
A, the service side:
1, the new Easerver profile as shown below. Server name is the computer name. Port number is 9000,login name Jagadmin.
2, in the new----target----easerver Component Start Wizard
3, Next-next- application name, library file storage-next-implement New interface--pbobjectname (n_cst_base) easerver Component Name--easerver profile--pakeage Name (the component adds a package as a package or chooses an existing package)--component Type (Stadard Component)--instance Pooling options (supported)--transaction supported Option (not supported)--interface options (Next)--other options ( Select All)--project (Next)--next--next--finish
4. Open the component n_cst_base you just created, in the constructor event:
SQLCA. DBMS = "MSS Microsoft SQL Server 6.x"
SQLCA. Database = "jaguar_2001"
SQLCA. ServerName = "Jaguarcts"
SQLCA. Logid = "sa"
SQLCA. Autocommit = False
SQLCA. Dbparm = ""
CONNECT USING SQLCA;
IF SQLCA. SQLCODE =-1 THEN
MessageBox ("System", "Database connection failed!") +sqlca. Sqlerrtext)
End IF
5, in the n_cst_base of the destructor event:
Disconnect Using SQLCA;
6. Add an object function to the N_cst_basek:
Of_user_login (String as_userid,string as_password) return integer
//
Integer Li_return
SELECT Count (*) Into:li_return from jag001 WHERE jag0101 =: As_userid and jag0102 =: As_password;
Return Li_return
Jag001 table fields: jag0101 (varchar)-jag0102 (varchar (20))
7. Generate Component Proxy objects
New--project----easerver Proxy Wizard has been next, it is noteworthy that when a TreeView appears, let you select a package (that is, the package created in 3), the next step is to select a proxy library (optional existing PBL, Also can add a PBL), Next is Deployment Actions, to select three (proxy object name = Package name + component name)
8, if not an accident, the proxy object is generated.
B, client:
1, a new application.
2. Create a new Connection object
New--pbobject--connection Object Wizard It is worth noting connectivity Options (Requires EAServer Connection); pakage Name is the package created in 3. The Connection object name can be either default or self input; Resource of connect information may be optional.
3, in the new application of the Open event:
Connection object declaration created by N_cst_connect Inv_connect_srv//2
Jaguar_2001_n_cst_base inv_login_srv//proxy Object declaration
Integer Li_return
IF Li_return <> 0 THEN
MessageBox ("Error Info", "errorcode=" + string (inv_connect_srv). Errcode) + "~nerrtext=" + inv_connect_srv. Errtext)
End IF
TRY//Login with one row of data in the table (xzh2000,000000)
Li_return = Inv_login_srv.of_user_logon (' xzh2000 ', ' 000000 ')
CATCH (cts_pbuserexception uae1)
Li_return = 999
End TRY
If Li_return = 1 Then
Messagebox ("System", "OK")
Else
Messagebox ("System", "Cancel")
End If
Three notes:
This article is in the Jaguar Manage (DEBUG) launch case, if in doubt, please email: to: xzh2000@fm365.com
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.