Re: clobs and blobs

From: Andrea Spinelli (aspinelli_at_no-spam-please-imteam.it)
Date: 07/27/04


Date: Tue, 27 Jul 2004 19:04:18 +0000 (UTC)

Micha³ <firewire1@wp.pl> wrote in
news:ce50fq$mgh$1@atlantis.news.tpi.pl:

> I want write new clobs and blobs to database. The problem is I
> don't
> know how to create Clob or Blob object

In my experience (SQL Server, mysql, postgres) you build a string
with the content
  String str = "....";
  preparedStatement.setBytes( index, str.getBytes() );

Or, you can use a byte array:
  byte a[] = new byte[16384];
  for( int i=0;i<16384;i++){ a = (i&255); }
  preparedStatement.setBytes( index, a );

-- 
  Andrea Spinelli - IT&T srl aspinelli@no-spam-plase-imteam.it
  Via Sigismondi, 40 - 24018 Villa d'Alme' (BG)
  tel: +39+035636029 - fax: +39+035638129   
  http://www.imteam.it/


Relevant Pages

  • Re: The future of Java
    ... I rate MySQL far, far below Postgres, Derby and the free versions of Oracle DB and IBM DB2. ... SQL Server or Oracle XE for my local work on Windows/Linux/Mac OS X lets me do everything I need to do to support my company's clients. ... In fact I use SQL Server on the odd .NET project only to keep acquainted; otherwise I'd pare my choices down to Postgres and Oracle XE. ...
    (comp.lang.java.programmer)
  • Re: data server choice
    ... I've heard the name Postgres a lot lately. ... Any opinion on MySQL? ... And SQL Server Express is supposed to be pretty cheap. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: any of you ever wrote a get_next_id function?
    ... Agreed that simultaneous requests will cause problems, ... outside of MySQL - e.g. SQL Server, Postgres - where auto_inc is not ...
    (comp.lang.php)
  • Re: SQL server vs mySQL ???
    ... SQL Server has the broadest range of tools and support utilities of any database system on the planet--by far. ... MS SQL versus MySQL? ... As of 5.0, MySQL finally supports stored procedures, so they are very similar there (you can genericize your data access a bit due to sprocs in both). ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Linking tables access - sql server 2005
    ... Another advantage of this method is that you don't need an ODBC setting on the local computer, ... Create a linked table to SQL Server without using a DSN ... Name of the table that you are linking to on the SQL Server database ... Function AttachDSNLessTable(stLocalTableName As String, stRemoteTableName As String, stServer As String, stDatabase As String, Optional stUsername As ...
    (microsoft.public.access.adp.sqlserver)