« Back to Configuring

Sybase Configuration

(Redirected from Sybase configuration for Liferay)

Table of Contents [-]

    After installing Sybase, here are the steps to configuring the database for Liferay.

    • Turn on Sybase service

    • Login to database ( Sybase Central ) username="sa" password=""

    • Select server name
    • Open up databases folder
    • Right click on "master" database -> properties

    Within the "master" database tab click devices

    • Highlight the "master" database, and hit the properties button
    • Under "Space allocated" increase the size of you database -> hit apply and then OK

    • In the "master" database properties hit edit, and increase the "Total space allocation" to 100MB
    • Hit "OK" in the "master" database properties
    • Click the icon to add a database
    • Enter in the database name "lportal"

    • Hit next
    • Add the "master" database's log and data

    • Hit edit on log and increase the log size -> hit ok

    • Hit edit on data and increase the log size -> hit ok

    • Hit next until the database is added.

    Note: may need to select "override" to create the database

    • Right click on "lportal" database -> properties
    • Select options tab and click on "allow nulls by default" and "select into/bulkcopy/pllsort" -> hit ok

    In the command prompt type in the following to run the database create script

    isql -Usa -P -Dlportal -i D:\Projects\liferay\portal\trunk\sql\portal\portal-sybase.sql

    In your root.xml for tomcat, you'll want to change your database connection to use you Sybase database.

    <Resource name="jdbc/LiferayPool"
    	auth="Container"
            type="javax.sql.DataSource"
            driverClassName="net.sourceforge.jtds.jdbc.Driver"
    	url="jdbc:sybase:Tds:IP_Address_Of_Database:5000/lportal"
            username="USER"
            password="PASSWORD"
            maxActive="100"
            maxIdle="30"
            maxWait="10000"
    />
    • In your ext environment, set the following properties to use Sybase.

    In portal.properties or portal-ext.properties set:

    For 4.1.2 add:

    hibernate.dialect=org.hibernate.dialect.SybaseDialect
    custom.sql.function.isnull=ISNULL 
    

    For 4.2.1 add:

    hibernate.dialect=org.hibernate.dialect.Sybase11Dialect
    
    hibernate.jdbc.batch_size=0
    
    custom.sql.function.isnull=ISNULL(CONVERT(VARCHAR,?), '1') = '1'
    custom.sql.function.isnotnull=ISNULL(CONVERT(VARCHAR,?), '1') = '0'
    

    For 5.1

    jdbc.default.jndi.name=
    
    jdbc.default.driverClassName=net.sourceforge.jtds.jdbc.Driver
    jdbc.default.url=jdbc:jtds:sybase://[ip address]:5000/lportal
    jdbc.default.username=sa
    jdbc.default.password=
    
    hibernate.dialect=org.hibernate.dialect.SybaseDialect
    custom.sql.function.isnull=ISNULL 
    
    

    For 5.2

    jdbc.default.jndi.name=
    
    jdbc.default.driverClassName=net.sourceforge.jtds.jdbc.Driver
    jdbc.default.url=jdbc:jtds:sybase://[ip address]:5000/lportal
    jdbc.default.username=sa
    jdbc.default.password=
    
    
    
    • Copy your sybase drives to Tomcat.

    Example: Copy lib/development/jtds.jar to <TOMCAT_HOME>/common/lib/jtds.jar You may need to copy one or more jars into the <TOMCAT_HOME>/common/lib folder - jtds.jar, jconn3.jar , jconn2.jar

    0 Attachments
    31968 Views
    Average (0 Votes)
    The average rating is 0.0 stars out of 5.
    Comments
    Threaded Replies Author Date
    Hi, I am using Sybase with Liferay and i was... Benjamin Lallement August 18, 2008 11:48 AM
    Instructions have been followed but am still... Kevin Gower July 8, 2010 1:30 PM
    The answer the problem is as follows. Install... Kevin Gower July 14, 2010 1:05 PM
    Character set for Sybase must be "nocase" as... Kevin Gower August 3, 2010 12:35 AM

    Hi,

    I am using Sybase with Liferay and i was stuck with the annoncement portlet because the part of the SQL query
    "com.liferay.portlet.announcements.service.persistence.AnnouncementsEntryFi­nder.countByHidden" :
    (AnnouncementsEntry.displayDate <= ? [$AND_OR_NULL_CHECK$])
    was crashing: "Syntax error during implicit conversion of VARCHAR value '1' to a DATETIME field."

    The solution is to modify the custom SQL function to:
    - custom.sql.function.isnull=ISNULL( CONVERT(VARCHAR,?) , '1') = '1'
    - custom.sql.function.isnotnull=ISNULL( CONVERT(VARCHAR,?) , '1') = '0'
    Posted on 8/18/08 11:48 AM.
    Instructions have been followed but am still not able to login admin/admin.

    DB is created and User_ still has screen name "test" any tricks to get it going on ASE 15.02?
    Posted on 7/8/10 1:30 PM in reply to Benjamin Lallement.
    The answer the problem is as follows.

    Install Sybase by creating liferay_data device and liferat_log device. 1GB and 300meg to start.

    Create the dataase and log

    Set DB to UTF8 before going any further. See Sybase manual on how to do this but you must do it. If you have a DB already and need to set it to UTF8 either bcp out everything then set it to UTF8 and bcp back in OR set it to UTF8 and then run dbcc, reindex, best down from Sybase Central on ALL tables

    Set your properties and root.xml as per above and up it will come.
    Posted on 7/14/10 1:05 PM in reply to Kevin Gower.
    Character set for Sybase must be "nocase" as there is an issue with TMS (task portlet) row TasksEntryID. Use sp_configure to set for the appropriate character set ID
    Posted on 8/3/10 12:35 AM in reply to Kevin Gower.