Subject RE: [Firebird-Java] Create database with Jaybird...using charset?
Author Robert DiFalco
No, but you can do this after the database is created:

st.executeUpdate(
"UPDATE rdb$database SET rdb$character_set_name='"
+ DB_CHARACTER_SET
+ "'" );

Remember to use this same constant (i.e. DB_CHARACTER_SET) in your info
properties when creating connections. Something like:

final Properties DB_INFO = new Properties();

DB_INFO.put( "user", DB_USER );
DB_INFO.put( "password", getSysdbaPassphrase() );
DB_INFO.put( "lc_ctype", DB_CHARACTER_SET );

public Connection createConnection() throws SQLException
{
return DriverManager.getConnection( DB_DRIVER_URL, DB_INFO );
}


We use "UNICODE_FSS".

R.

-----Original Message-----
From: bluenote [mailto:bluenote@...]
Sent: Monday, January 12, 2004 10:46 AM
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] Create database with Jaybird...using charset?


Is there a way to set the charset for a newly created DB within a java
app with a charset specified?

I use Tomcat and would like to ISO8859_1

FBManager does not seem to have the option. ( I even tried a url
variable).

Also tried..

PreparedStatement ps = null; //and Statement
...
ps.execute( "CREATE DATABASE XYZ.FDB ...

SPL? I could not get it to cooperate in this respect.


If this is not usual practice is it accepted/usual/better to use
...
new String(rs.getBytes(1),"encoding");

for every varchar/char column?

or a blob?


I could make a 'dummy.fbd' file and copy it everytime.

I was looking for something a little more elegant.

Any platform or version. Any suggestions or Manual references
appreciated.

Thanks

Yahoo! Groups Sponsor
ADVERTISEMENT






Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/Firebird-Java/

To unsubscribe from this group, send an email to:
Firebird-Java-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.