Hi Jason,
Thank you for your answer. Your code also works for me, and the only difference that I see is the jdbc.sqlanywhere connection string instead of the jdbc:sybase I use, so that's probably it.
I've found that I don't need the AS because my databasefilename and databasename are the same, so removing that works for me.