Re: Error with Clob

Tmo_hsqldb_q <[email protected]>
Newsgroups gmane.comp.java.hsqldb.user
Message-ID <[email protected]>
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
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.