Can anyone tell me, how can I create shared between connection objects? The following code doesn't work:
Code:
public final class Test {

    static {
        System.out.println("Static section");
    }
    public final static long a = System.currentTimeMillis();

    public static void main(String[] args) {
    }

    public String getStr() throws SQLException {
        return (new Long(a)).toString();
    }

}
As I run the following sql command:
Code:
select (new Test())>>getNum()
I can see that static initializer is executed only once within single connection and getStr() returns the same string. But when I execute the same SQL in new conneciton, static initializer is executed once more and getStr() returns other value. However "Java in ASE" SyBook says than final static fields are visible whithin many sessions

Is there other methods to keep global shared data between connections?

P.S. I need this functionality to redirect sql-requests from many connections to one single connection to solve Lock issue. So the sybase.asejdbc.ASEConnection should be this shared object...