I try to connect to SqlAnywhere 17 demoDB using a tool called DbSchema. The tool is using JDBC connection. For this I started SQL Central, then I also did
Then I try to connect as DBA/sql but I get 'failed login'. I tried also creating an user in SQL Central and connect using it, but connectivity still fails. The connection is done like this:
The error is
Any suggestion on what should I check ? |
A fix has been made to address "Driver not capable" errors reported accessing SQL Anywhere metadata information when supplying catalog information, i.e., the following JDBC call: ResultSet tables = metaData.getTables( conn.getCatalog(), "GROUPO", "%", types ); The error will continue to be reported if the database name of the connection does not match the supplied catalog. This has been addressed in Engineering Case #822551 in SQL Anywhere 17.0 Build 6194 and will be available in an upcoming patch. |
copy the dbjdbc17.dll found in your SQL Anywhere\Bin64 directory into the same directory that you copied the sajdbc4.jar and try it again. |
Same issue in linux and mac. In windows connect normally :( Has anyone already solved this problem? Can you start a new thread and provide the details of the issue (including any errors or exceptions) that you are seeing in Linux and Mac.
(01 Mar, 09:57)
Chris Keating
Replies hidden
Comment Text Removed
Thank you for response.
(01 Mar, 10:33)
mrV
|
Please show how you specify the user id and password. Use copy and paste rather than re-typing. Please show us the exact text of the error message.
The connection is done like this:
final Properties properties = new Properties(); properties.put( "user","DBA"); properties.put( "password","sql"); driver.connect( "jdbc:sybase:Tds:localhost:2638/demo?LITERAL_PARAMS=true", properties );
The error is
java.sql.SQLException: JZ00L: Login fehlgeschlagen. �berpr�fen Sie SQLWarnings zu diesem Fehler, um die Ursache zu sehen.
translatedLogin failed. Check SQLWarnings about this error to see the cause.
I don't know how to get the SQLWarnings.It seems that DbSchema defaults to using the old slow jconnect JDBC driver jconn4d.jar rather than the new fast SQL Anywhere JDBC driver sajdbc4.jar
For more information about the two drivers see https://help.sap.com/viewer/98ad9ec940e2465695685d98e308dff5/17.0/en-US/3bd02ce86c5f101482b78476939fb83a.html?q=jdbc
You may need to install the SAP Java Development Kit (JDK) to get jconn4d.jar. For more information ( good luck! you'll need it :) see https://wiki.scn.sap.com/wiki/display/SQLANY/Downloading+the+jConnect+driver
sajdbc4.jar comes with SQL Anywhere, but you may have to tell DbSchema how to use it (see the Manage Drivers button).
I got stuck on the funky DbSchema - Manage Drivers - +New - "JDBC URL with tags" field.
I tried these wild guesses...
FYI the driver is located here C:\Program Files\SQL Anywhere 17\Java\sajdbc4.jar
Got this far...
Maybe the DbSchema folks can help.
I am unconvinced that DbSchema supports SQL Anywhere. This tool incorrect supplies only the jar file and misses a number of native libraries that must be the same version as the jar. Copying your SQLA install sajdbc4.jar to the c:\Users\<user>.DbSchema\drivers\SQLAnywhere and adding the following into DbSchema.vmoptions (in the root of the install) -Djava.library.path=<path_to_sqla_binaries>. This allows you to connect but then it incorrectly attempts to treat tables as databases (or schemas) resulting in exceptions. There are also exceptions after a successful connection with using jConnect (I had no issues with making a connection to the demo DB - although it is assuming that you are connecting to ASE so modifications to the URL may be needed in a SA context). If I understand the exception, it also appears to be tripping up trying to deal with schemas.
Great, thank you! This works for me as well with the same issues. I wrote to DbSchema team and they will check the exception right this days. I will write again here when is fixed.
Thank you as well for checking this. Same issue, I will write back when I have an update from DbSchema.
> unconvinced that DbSchema supports SQL Anywhere
That may be true, but the inverse may also be true; i.e., you can make SQL Anywhere support DbSchema :)
I have found a workaround. The issue appears to be that the DBSchema tool is executing DatabaseMetaData.getTables method supplying the 'catalog' as a parameter to this method. SQL Anywhere does not understand that since there is technically not a catalog. We accept NULL and an empty string and throw a driver not capable error otherwise. For ODBC connections, we can suppress that by setting the "Prevent driver not capable errors". If you create a DSN for you connection, you can take advantage of this by connecting using a DNS i.e., the URL "jdbc:sqlanywhere:dsn=SQL Anywhere 17 Demo". I will investigate if it is possible to pass this option to JDBC directly.
If you are using the SQLA JDBC driver to connect, you can use the PreventNotCapable connection option to ignore the driver not capable error. Here is an example URL:
jdbc:sqlanywhere:eng=demo17;uid=dba;pwd=sql;PreventNotCapable=YES