problem about database

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

alvin3343
Posts: 80
Joined: 24 Jan 2006, 09:37

problem about database

Postby alvin3343 » 17 Mar 2006, 03:51

Hi Lapo,
First of all, thanks for your help.

My problem is that I can't retrive Traditional Chinese char from database.
I use SQL2000 with jre built-in ODBC connector and the data type is nvarchar.

Code: Select all

   
var sql="SELECT account, password, nickname, state FROM member WHERE account ='"+nick+"'";

//    value of nickname column is a Traditional Chinese char (nvarchar)

      var queryRes=mydb.executeQuery(sql);
        if(queryRes.size()>0){
            var tempRow=queryRes.get(0);
            trace(tempRow.getItem("account"));     //correct
            trace(tempRow.getItem("nickname")); // "" no content   
        }

None Traditional Chinese datas are all correct
but value of nickname column can't be retrived ,
and tempRow.getItem("nickname") is "".
(I am sure that nickname column has its value.)
Where is the problem?

regards.
---------------------
alvin3343
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 17 Mar 2006, 09:37

Sounds weird. If you pass the correct colum name I can't see why you shouldn't be able to get it.

Are you sure you don't have a typo?

If you have other column names, what happens if you try to get them?
Lapo
--
gotoAndPlay()
...addicted to flash games
alvin3343
Posts: 80
Joined: 24 Jan 2006, 09:37

Postby alvin3343 » 17 Mar 2006, 12:24

Other columns contained English or numeric data can be got correctly.
It's wired.
Did you have ever heard this kind of problem?

And is the follwing setting correct?
I downloaded a sql2000 driver and copied its lib to java_dir\lib\ext .
sql2000 and sfs are in the same machine.
database name is testdb.

Code: Select all

         <DatabaseManager active="true">
                  <Driver>com.microsoft.jdbc.sqlserver.SQLServerDriver</Driver>
<ConnectionString>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=testdb</ConnectionString>
                  <UserName>username</UserName>
                  <Password>pass</Password>
                  
                  <TestSQL><![CDATA[SELECT COUNT(*) FROM NieoMember]]></TestSQL>
                  <MaxActive>10</MaxActive>
                  <MaxIdle>10</MaxIdle>
                  
                  <OnExhaustedPool>fail</OnExhaustedPool>
                  <BlockTime>5000</BlockTime>
                  
         </DatabaseManager>
alvin3343
Posts: 80
Joined: 24 Jan 2006, 09:37

Postby alvin3343 » 17 Mar 2006, 22:34

I know the reason why.
That's porbably the built-in jdbc driver's bug.
After changing to ms driver, everything goes right.
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 18 Mar 2006, 07:40

oh, very well and good to know :)
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 21 guests