Re: Error with Clob

Fred Toussi <[email protected]>
Newsgroups gmane.comp.java.hsqldb.user
Message-ID <1363900689.20313.140661207506393.18C3CBC9@webmail.messagingengine.com>
I don't know what this test is supposed to prove. Why not just insert
the data and perform a SELECT afterwards to see if your data is there.
Use an ID primary key column for your table to be able to select
individual rows from it.

Note you are also using a lot of memroy with LONGVARCHAR.

Fred

On Thu, Mar 21, 2013, at 21:07, Tmo_hsqldb_q wrote:
> Adding my test code incase you need it:
> 
> 
> 
> CREATE TABLE testtable 
> ( 
>    longvarcharcolumn LONGVARCHAR     NOT NULL 
> ); 
> 
> 
> 
> CREATE TRIGGER testtable_TRIG AFTER INSERT ON testtable 
> referencing NEW ROW AS newrow 
> FOR EACH ROW WHEN (newrow.longvarcharcolumn IS NOT NULL) 
> CALL testtableupdate(newrow.longvarcharcolumn); 
> 
> 
> 
> 
> CREATE PROCEDURE testtableupdate(testmessage longvarchar) 
> MODIFIES SQL DATA 
> LANGUAGE JAVA 
> EXTERNAL NAME 'CLASSPATH:TestTableTrigger.testTableUpdate' 
> 
> 
> 
> 
> import java.sql.*; 
> 
> public class TestTableTrigger 
> { 
> 
>         public static void testTableUpdate(Connection triggerConn, String
> testmessage) throws Exception 
>         { 
> 
>                         System.out.println("TestTableTrigger -
>                         testmessage =
> " + testmessage); 
>         } 
> 
> } 
> 
> 
> 
> 
> 
> 
> CREATE PROCEDURE testlongvarchar(testmessage longvarchar) 
> MODIFIES SQL DATA 
> BEGIN ATOMIC 
> 
>      INSERT INTO testtable(longvarcharcolumn) 
>      VALUES(testmessage); 
> 
> END 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> import java.sql.*;
> import java.io.*;
> 
> public class TestHSQL
> {
> 
> 	public void runTest()
> 	{
> 		ResultSet rs = null;
>     	try {
>     	    Class.forName("org.hsqldb.jdbc.JDBCDriver" );
> 
>     		Connection hsqlConn =
> DriverManager.getConnection("jdbc:hsqldb:hsql://localhost:9107/facadestore;ifexists=true",
> "SA", "");
> 
> 			System.out.println("Got connection");
> 
> 			BufferedReader br = new BufferedReader(new
> FileReader("C:\\TonyProject\\test\\testhsqldblongvarchar\\verylongstring.txt"));
> 
> 			String verylongString = br.readLine();
> 
> 			System.out.println("Got verylongString = " + verylongString);
> 
> 
> 			CallableStatement cstmtLongVarchar = hsqlConn.prepareCall("call
> testlongvarchar(?)");
> 
> 			cstmtLongVarchar.setString(1, verylongString);
> 
> 			cstmtLongVarchar.execute();
> 
> 			cstmtLongVarchar.close();
> 
> 			hsqlConn.close();
> 
> 		} catch (Exception e) {
>     	    e.printStackTrace();
>     	    return;
>     	}
> 
> 	}
> 
> 	public static void main(String args[])
> 	{
>        TestHSQL th = new TestHSQL();
>        th.runTest();
> 	}
> 
> }
> 
> 
> 
> 
> --
> View this message in context:
> http://hsqldb.10974.n7.nabble.com/Error-with-Clob-tp151p3858.html
> Sent from the HSQLDB - User mailing list archive at Nabble.com.
> 
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Hsqldb-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/hsqldb-user

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.