Installation Notes For Sybase Database

Expresso 5.0 Note: Sybase does not allow null values for bit datatypes, therefore the definition of com.jcorporate.expresso.ext.dbobj.DownloadFiles must be changed. Locate the following line:

addField("IsRestricted", "boolean", 0, true, "Restricted Download?");

and change it to:

addField("IsRestricted", "boolean", 0, false, "Restricted Download?");

When you connect to your Sybase database, there are two different methods of connection. One is using a straight JDBC driver which requires the Sybase drivers to be installed and available in your WEB-INF/lib directory. The second method is through a JNDI server. The first configuration shows the raw JDBC connections, and the second shows how to connect through JNDI.

  	
	<context name="default">
	<description>Sybase Database</description>    
	<jdbc        
		driver="com.sybase.jdbc2.jdbc.SybDriver"	
		url="jdbc:sybase:Tds:[host]:2638/[dbName]"	
		connectFormat="1"	
		login="your_login"
		password="your_password"	
		cache="y" />    
	<type-mapping>		
		<java-type>LONGVARCHAR</java-type>		
		<db-type>VARCHAR</db-type>  
	  </type-mapping>  
	  <type-mapping>	
		<java-type>VARCHAR</java-type>	
		<db-type>VARCHAR</db-type>   
	 </type-mapping>    
	<type-mapping>		
	<java-type>DATE</java-type>	
		<db-type>DATETIME</db-type>
	</type-mapping>  
	  <type-mapping>	
	<java-type>TIME</java-type>	
	<db-type>TIME</db-type>	</type-mapping>
	<type-mapping>	
	   <java-type>FLOAT</java-type>	 
	  <db-type>FLOAT</db-type>   
	 </type-mapping>
	<type-mapping>	 
  <java-type>DECIMAL</java-type>
	   <db-type>NUMERIC</db-type>   
 </type-mapping>
	<type-mapping>
	   <java-type>TIMESTAMP</java-type>
	   <db-type>DATETIME</db-type> 
   </type-mapping>  
  <images>%context%/%expresso-dir%/images</images>  
  <startJobHandler>y</startJobHandler>   
 <showStackTrace>y</showStackTrace>   
 <mailDebug>n</mailDebug> 
 </context>

	<context name="default">
		<description>Sybase Driver</description>
		<hasSetupTables>n</hasSetupTables>
		<jdbc driverType="datasource" 
			driver="com.sybase.jdbc2.jdbc.SybDriver" 
			url="java:comp/env/jdbc/DatabaseName" 
			connectFormat="1" 
			login="mylogin" 
			password="mypassword" 
			cache="y" 
			useNullOnCreate="y" 
			escapeHandler="com.jcorporate.expresso.core.db.DoubleQuoteEscapeHandler">
			<jndi/>
		</jdbc>

		<type-mapping>
			<java-type>LONGVARCHAR</java-type>
			<db-type>TEXT</db-type>
		</type-mapping>
		<type-mapping>
			<java-type>VARCHAR</java-type>
			<db-type>VARCHAR</db-type>
		</type-mapping>
		<type-mapping>
			<java-type>DATE</java-type>
			<db-type>DATETIME</db-type>
		</type-mapping>
		<type-mapping>
			<java-type>TIME</java-type>
			<db-type>TIME</db-type>
		</type-mapping>
		<type-mapping>
			<java-type>FLOAT</java-type>
			<db-type>FLOAT</db-type>
		</type-mapping>
		<type-mapping>
			<java-type>DECIMAL</java-type>
			<db-type>NUMERIC</db-type>
		</type-mapping>
		<type-mapping>
			<java-type>TIMESTAMP</java-type>
			<db-type>DATETIME</db-type>
		</type-mapping>
		<images>%context%/%expresso-dir%/images</images>
		<startJobHandler>n</startJobHandler>
		<showStackTrace>y</showStackTrace>
		<mailDebug>n</mailDebug>
	</context>

 

This configuration is reported to have a problem with Test1 concerning the Float and Real types. Also the JConnect tables must be already in the database.