Jump to content
We've recently updated our Privacy Statement, available here ×

Retrieves data from two kind of database~


chichigi

Recommended Posts

Hi,

 

I try to retriever data from database sqlserver and oracle. The Chinese character is displayed correctly for MS SqlServer, but is displayed incorrectly for Oracle. I do not know how to slove this problem.

May somebody help me?

 

Thanks.

 

iReport Version : 1.2.6

Pdf font name : c:windowsfontsmingliu.ttc,1

Pdf Embedded : checked

Pdf Encoding : Identity-H (Unicode with horizontal writing)

 

\HKEY_LOCAL_MACHINESOFTWAREORACLEKEY_OraClient10g_home1 NLS_LANG -> AMERICAN_AMERICA.US7ASCII

Link to comment
Share on other sites

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

I know is a question of the subject, and excuses for that, but you mention having a report from two different datasources. You mean by that at the same time or one at a time?

 

I've been looking for way to have a report in one datasource and a subreport in another. If this is the case I'll appreciate some light there.

 

Thanks and excuses again for being out of the subject here.

Link to comment
Share on other sites

you do not say what you are trying to do., and if the problem is with a jasper report.

where is the character data , displayed and HOW did you get it.

 

oracle automatically does code page translation on character fields.

so you need to ensure the oracle database is setup for multibyte characters.

 

and it aint gonna happen with your NLS set as good ol 7bit ascii, is it?

Link to comment
Share on other sites

I changed the connection and retrieve data individually.

What's the difference "at the same time" or "one at a time"?

 

Here are some connection configuration.

 

1.Oracle Connection

JDBC Driver : oracle.jdbc.driver.OracleDriver

JDBC URL : jdbc:oracle:thin:@192.168.1.101:1521:F0

 

2.SQL Server Connectio

JDBC Driver : net.sourceforge.jtds.jdbc.Driver

JDBC URL : jtds:sqlserver://192.168.1.232:1433/TGA

 

It seems my oracle db does not surport mutibyte...

Link to comment
Share on other sites

getting data from 2 sources is NOT a problem.

even with the subreport using the data from a different database.

 

it's all down to you needing a customdatasource class , that's all, very easy.

 

The oracle not displaying Chinese.

 

you must INSTRUCT the database to store multi-byte characters, if you do not then it will not, it is not a mind reader , it is only a data manipulator.

 

There is however a way round it, even if you have your database set to ASCII.

 

you can store the Chinese data in BLOB's , NOT CLOB.

 

Varchar2, CLOBS , ARE FILTERED datatypes, in that they are passed thru your NLS settings, ALways on the RDBMS and sometimes on the client, depending on which drivers you are using.

 

BLOBS are not filtered.

 

If your oracle is commisioned in Asia, I would guess that Multibyte is already enabled.

Link to comment
Share on other sites

  • 3 months later...

I'm still working with it but something like this mike help:

 

Code:
java.sql.DriverManager.getConnection("jdbc:db2://[ip address]:[port]/[DB name]", "[user]", "[password]"«»)

 

I'm using that in a subreport Connection/Data Source Expresion to connect to a different Database. Workin to make the parent report use the results from that subreport.

 

Hope it helps.

Link to comment
Share on other sites

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...