Quantcast
Channel: SCN : Discussion List - SAP SQL Anywhere
Viewing all articles
Browse latest Browse all 125

Connection String Special char

$
0
0

Hello,

 

I have a problem with databasenames with special characters in the name:

 

(My code works when there is not a special char in the name)

 

For example, when my connectionstring would be:  jdbc:sybase:Tds:localhost:2638?ServiceName=BANDENM&W

I get a java.sql.SQLException: JZ00L: Login failed.  Examine the SQLWarnings chained to this exception for the reason(s). at line 3 while my pasw and login are correct.

 

 

Class.forName("com.sybase.jdbc3.jdbc.SybDriver");  String connectionString = "jdbc:sybase:Tds:" + config.getHost() + ":" + config.getPort() + "?ServiceName=" + databaseName;  Connection connection2  = DriverManager.getConnection(connectionString, config.getUser(), config.getPassword());  //get VC client customer info  statement = connection2.createStatement();  resultSet2 = statement.executeQuery("SELECT CNR_SUPP,CNR_CUST,TNR_ID,NM_ID,CNR_VAT_ID,NM_FILTER_ID,CNR_ZIP_ID,CNR_VATCNTRY_ID,NM_TOWN_ID,TOP_COUNTRY.CNR_INTRASTAT FROM TOP_IDENTITY JOIN TOP_COUNTRY ON (TOP_IDENTITY.COD_CNTRY_ID = TOP_COUNTRY.COD_CNTRY)");

When I add double quotes around the databaseName, I get to line 8 but then I get an error:

com.sybase.jdbc3.jdbc.SybSQLException: ASA Error -141: Table 'TOP_IDENTITY' not found

 

But the table is again, definitely there ...

 

I've tried escaping it by replacing & with &

But no luck.


Viewing all articles
Browse latest Browse all 125

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>