Sybase Tips
sp_helptext on sp_help
use sybsystemprocs; sp_helptext sp_help;
Visual Basic ADO connection string
Dim Conn As New ADODB.Connection Conn.CursorLocation = adUseClient ' <-- needed for return params Conn.Open "Provider=Sybase.ASEOLEDBProvider;Server Name=myserver.foo.com,1400;Initial Catalog=my_database;User Id=sa;Password=" Conn.Execute ("Select @@version") ' Test to make sure the connection is ok
Java CallableStatement named parameters
You're trying to do something like:
CallableStatement cs = conn.prepareCall("{?= call sp_help ?}"); cs.setString("@objname", "sp_help");
and you get an exception like
java.lang.AbstractMethodError: com.sybase.jdbc2.jdbc.SybCallableStatement.setString(Ljava/lang/String;Ljava/lang/String;)V at ConnectionTest.testCallable(ConnectionTest.java:66) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:154) at org.jmock.core.VerifyingTestCase.runBare(Unknown Source) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:474) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:342) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:194)
This is life with Sybase. It doesn't matter if you use jconn2.jar, jconn3.jar, or even jTDS.jar. Maybe you could enhance jTDS.jar. If you do, please send me an email!