This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 69265 - I18N - unable to create a db with chinese character - infomational exception
Summary: I18N - unable to create a db with chinese character - infomational exception
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Derby (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: John Baker
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2005-11-24 14:04 UTC by Marek Grummich
Modified: 2008-09-11 13:02 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exception (1.21 KB, text/plain)
2005-11-24 14:05 UTC, Marek Grummich
Details
image (64.30 KB, image/jpeg)
2008-09-10 16:44 UTC, kaa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Grummich 2005-11-24 14:04:45 UTC
Build 200511231900 + sjsas_pe-8_2_2005Q2

if user wants to create a database that has chinese, multibyte character in its
name, NO database is created and infomational (attached) exception is thrown in
the console.
Note: When name of database doesn't contain these characters then it is allowed
to use them in the table, column and values.
Comment 1 Marek Grummich 2005-11-24 14:05:27 UTC
Created attachment 27246 [details]
Exception
Comment 2 Andrei Badea 2005-11-24 16:22:30 UTC
Looks like a bug in Derby. I'm getting the same error from a simple JDBC
application which just connects using the URL:

jdbc:derby://localhost:1527/\u4e10;create=true

Hopefully we'll be able to workaround by using the embedded driver to create the
database, that seems to work, but it's slower, since the Derby system has to be
booted and then shut down (instead of telling an already booted server to create
a new database).

I can experience it even with the newest release (10.1.2.1). Filed Derby issue 

http://issues.apache.org/jira/browse/DERBY-728
Comment 3 Andrei Badea 2005-12-02 11:24:11 UTC
From one of the Sun people working on Derby:

The DRDA protocol is open-ended wrt. metadata encoding (the standard
supports most known encodings and EBCDIC is the default). Presently,
only EBCDIC encoding is implemented in the Derby client and server.

I have investigated the code involved, and it is pretty simple to
write more encoders/decoders, I even tested with a UTF16-replacement
of the EBCDIC encoder/decoder. BUT: the code *using* the
encoder/decoder is written out of the assumption that one character
maps to one byte on the wire, so it might not be straight forward to
fix http://issues.apache.org/jira/browse/DERBY-728
Comment 4 Andrei Badea 2005-12-02 11:24:57 UTC
A possible workaround is to check the database name for characters which map to
a single byte when converted to EBCDIC.
Comment 5 Andrei Badea 2005-12-06 20:38:05 UTC
Upon NetCAT request I added a warning that some characters (other than the
interval U+0020..U+00FF) may be unsupported in the database name.

Checking in src/org/netbeans/modules/derby/ui/Bundle.properties;
/cvs/db/derby/src/org/netbeans/modules/derby/ui/Bundle.properties,v  <-- 
Bundle.properties
new revision: 1.7; previous revision: 1.6
done
Checking in src/org/netbeans/modules/derby/ui/CreateDatabasePanel.java;
/cvs/db/derby/src/org/netbeans/modules/derby/ui/CreateDatabasePanel.java,v  <--
 CreateDatabasePanel.java
new revision: 1.6; previous revision: 1.5
done
Comment 6 Andrei Badea 2005-12-07 20:27:21 UTC
This issue is waived for 5.0. Will be mentioned in the release notes.
Comment 7 Petr Jiricka 2006-06-23 13:56:48 UTC
Marek and Ken, given the fact that Andrei implemented a warning that guides the
user, is this still a P2? Can it be downgraded? Thanks.
Comment 8 Ken Frank 2006-06-23 18:33:31 UTC
How about if it just does not allow mbyte or other non ascii
in it - the current warning says the first mbyte char it sees
might be unsupported in dbase name
but it allows ok to be selected 

then the error popup says
An error occured while creating the database: Unicode string can't convert
to Ebcdic string"

which does not seems clear and not tell really if dbase created and there was an
error or if dbase just not created (it was not)

so if just disallow the dbase create window to complete, it will be clearer
to user.

ken.frank@sun.com
Comment 9 Andrei Badea 2006-06-26 13:23:52 UTC
The current message is not an error message but a warning in order to ensure we
don't prevent creating databases on a hypotetical version of Derby in which
DERBY-728 was fixed. 
Comment 10 Andrei Badea 2006-06-28 12:25:39 UTC
I don't see a strong disagreement with downgrading this to P3, so downgrading.

I don't have a really strong opinion about the warning vs. error message issue.
If anyone strongly believes it would better (considering the consequences) to
prevent the user from creating a database with characters outside the supported
range in its name then let's do it.
Comment 11 Andrei Badea 2007-02-15 17:40:42 UTC
DERBY-728 is still open. Tentatively setting TM to 6.0.
Comment 12 David Vancouvering 2008-01-10 00:13:52 UTC
It seems to me that rather than preventing users from creating databases with multibyte characters, we should provide a
better error message when it fails.  Each Derby exception has a unique code.  It's not a stable interface, but we could
check the code and if it matches, we can provide more information such as "we were unable to create the database because
Java DB/Derby does not support multibyte characters."

Does this seem reasonable?
Comment 13 Ken Frank 2008-01-10 01:15:18 UTC
my 2 cents - it sounds like good idea.

perhaps also we should add to release notes since its does not seem
clear in derby docs that this is the case, or if its there, it might
not be as visible up front.
 
ken.frank@sun.com
Comment 14 John Baker 2008-08-29 21:16:34 UTC
5b5e662553ff
Comment 15 Quality Engineering 2008-08-30 05:30:49 UTC
Integrated into 'main-golden', available in build *200808300201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/5b5e662553ff
User: John Baker <jbaker@netbeans.org>
Log: #69265 I18N - unable to create a db with chinese character - infomational exception
Comment 16 kaa 2008-09-10 16:43:55 UTC
In NetBeans 0909 build (OpenSolaris, zh locale) I can't create database using zh chars.
There is a warning message (see image). Does it expected behavior after the fix?
Comment 17 kaa 2008-09-10 16:44:30 UTC
Created attachment 69550 [details]
image
Comment 18 John Baker 2008-09-10 18:41:01 UTC
It is correct that a database name with multibyted cannot be created.  The message could be improved though.

I had changed another message in the Connection dialog and changed the create database to error.

I can improve the message slightly
Comment 19 kaa 2008-09-11 13:02:37 UTC
Verified: database with multi byte chars in name can not be created.