« 返回到 Configuring

Sybase Configuration

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 附件
    63926 查看
    平均 (0 票)
    满分为 5,平均得分为 0.0。
    评论
    讨论主题回复 作者 日期
    Hi, I am using Sybase with Liferay and i was... Benjamin Lallement 2008年8月18日 上午11:48
    Instructions have been followed but am still... Kevin Gower 2010年7月8日 下午1:30
    The answer the problem is as follows. Install... Kevin Gower 2010年7月14日 下午1:05
    Character set for Sybase must be "nocase" as... Kevin Gower 2010年8月3日 上午12:35

    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'
    在 08-8-18 上午11:48 发帖。
    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?
    在 10-7-8 下午1:30 发帖以回复 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.
    在 10-7-14 下午1:05 发帖以回复 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
    在 10-8-3 上午12:35 发帖以回复 Kevin Gower