Jump to content

How to connect sql server JDBC with database name containing space


Go to solution Solved by Tom C,

Recommended Posts

Posted

I'm trying to create data adapter in Jaspersoft Studio but got problem with JDBC url, my database name containing space :

JDBC Driver : com.microsoft.sqlserver.jdbc.SQLServerDriver

JDBC Url : jdbc:sqlserver://192.170.170.3:1433;databaseName=Astrindo Starvision [Operational]_140804           -----> my database name is Astrindo Starvision [Operational]_140804

Please help

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

Have you tried using any of the following escape codes to replace  the space?

%20u0020Ȁx0020 [/code]

Also note these are kind of system or O.S. dependant so it may work on your
test system but not on a live server.
You also need to lookout for double encoding, e.g. %20 gets encoded into %2520
So you may need to play around with "  and '
 

Posted

Hi Tchen,

Thanks it's works, i can create dataset in Jaspersoft Studio. by the way i also need to create data source in Jaspersoft server using the same database but problem using curly braces.

Url : jdbc:sqlserver://192.170.170.

3:1433;databaseName={Astrindo Starvision [Operational]_tes}
Error : The JDBC URL contains invalid characters. You might have mistyped it

Could you please help again :)
Thanks
===================================================================
 
Answer:
 
This is a known limitation in JasperReports Server security edit. We have an enhancement request (internal reference number 40930) already filed to address this need and it is currently under review without an ETA on when it will be implemented.
 
What you can do in this case is to define a JNDI data source in your application server and use it to connect to your MySQL DB and run report in the server. Please refer to this custom wik article for JNDI configuration in Tomcat:
 
http://community.jaspersoft.com/wiki/how-add-new-jndi-connection-tomcat

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...