on 2011 Sep 30 2:07 PM
Hi,
I am using Sybase SQL Anywhere 9.x. I faced very interesting problem and am not sure if its really a problem or as designed.
I am not able to log-in to DB once I set the password to "i+:7-)DB". Am using GRANT CONNECT TO "dba" IDENTIFIED BY "i+5:Q7-)DB" command to set the password.
The error it gives while logging-in is "JZ002: Password property "too long. Maximum length is 30."
Does sybase expand passwords if they contain special characters like +,-"'() etc. And truncates the password to max 30 characters while setting the password?
Thanks in advance. Vineet
I tried v90 and it worked fine too. I think the error you are seeing is not from the database server: "JZ002" isn't one of the engine's error codes. What app are you using to connect with? Maybe it is specific to that app?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The message is coming from jConnect: http://www.sybase.com/detail?id=1009784
Maybe jConnect doesn't like that combination of characters, and is throwing this confusing message about length.
Using jConnect within a JDBC application can sometimes be tricky. Note that there are three ways to specify connection options (specifically, login options) to a JDBC Connection from a DriverManager object:
.getConnection(String url, Properties info)
.getConnection(String url, String user, String password)
Note that the login information can either be contained directly on the JDBC URL string (e.g. 'pwd='), in a properties file, or directly provided to the .getConnection() call as a parameter.
How you are actually passing the password to the JDBC driver in your reproducible?
Here is my attempt at using your specified password, with dbisql, from the command line on version 9.0.2.3951 - this seems to work for me. Also to keep in mind, (and as Volker correctly points out) 9.0.2 has been end-of-life'd and the "-jconnect" option on dbisql is no longer supported in current versions.
=====================
> dbinit v9.db Adaptive Server Anywhere Initialization Utility Version 9.0.2.3951 Creating system tables Collation sequence: 1252LATIN1 Creating system views Setting permissions on system tables and views Setting option values Initializing UltraLite deployment option Database "v9.db" created successfully > dbspawn dbsrv9 v9.db Adaptive Server Anywhere Start Server In Background Utility Version 9.0.2.3951 > dbisql -c "UID=dba;PWD=sql;ENG=v9" GRANT CONNECT TO "user1" IDENTIFIED BY "i+5:Q7-)DB"; Execution time: 0.003 seconds > dbisql -jconnect -c "UID=user1;PWD=i+5:Q7-)DB" -host localhost -port 2638 Connected
=====================
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A bunch of password-related changes were made to SA version 10.0, and I verified that the GRANT statement you listed in your question behaves as expected in 10.x, 11.x, and 12.x. It wouldn't surprise me that some non-alphanumeric characters did not work properly in version 9.x, but I don't have the code for 9.x in front of me, nor do I have 9.x installed anymore, so I can't confirm.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks to all for replying..
I am connecting to Db using 'jconnect' and then running GRANT command. command am using: dbisql.exe -jconnect -c "FILEDSN=path.dsn"
Is there a way to know what all characters not supported by SA or jconnect driver?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This Microsoft topic might help:
http://msdn.microsoft.com/en-us/library/ms378428.aspx
Scroll down to see this...
Escaping Values in the Connection URL
You might have to escape certain parts of the connection URL values because of the inclusion of special characters such as spaces, semicolons, and quotation marks. The JDBC driver supports escaping these characters if they are enclosed in braces. For example, {;} escapes a semicolon.
Escaped values can contain special characters (especially '=', ';', '[]', and space) but cannot contain braces. Values that must be escaped and contain braces should be added to a properties collection.
Note White space inside the braces is literal and not trimmed.
Ok, so here is something i figured out. I have two DB running A and B command to connect to A is dbisql -onerror exit -jconnect -c "FileDSN=path"
A runs on default port 2638
For B, command is dbisql -jconnect "FILEDSN=path" -host localhost -port 3989
JZ002 error occurs in case of B. Its coming even with a single bracket")" character
Error is coming from jdbc driver. But reason is not valid for this.
For A ")" in password gives invalid username and password
I'm still trying understand:
Is this is correct, what are the differences between A and B (or the difference in the FileDSNs for both)?
What does happen when you use GRANT CONNECT with a "simple" PWD, say "IDENTIFIED BY myPwd"?
What does happen when you run the same script with "dbisql -odbc" or when using dbisqlc?
point 1, 2, and 3 succeeds(I am able to reset the password using GRANT command). Problem comes when I am trying to connect using DBISQL to database B.
The only difference in two DBs is the way we are connecting to them
DB B is running on different port.
I understand " ; special characters cannot be used inside passwords. But the problem am facing are with other characters too like )(}{
User | Count |
---|---|
81 | |
11 | |
10 | |
10 | |
10 | |
8 | |
7 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.