PreparedStatement.execute() failes...
From: Georg Andersson (georg.andersson_at_swisstopo.ch)
Date: 07/26/04
- Next message: Gerd Nachtsheim: "Re: PreparedStatement.execute() failes..."
- Previous message: Claudio Alberto Andreoni: "Re: What about a new DB without SQL?"
- Next in thread: Gerd Nachtsheim: "Re: PreparedStatement.execute() failes..."
- Reply: Gerd Nachtsheim: "Re: PreparedStatement.execute() failes..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 26 Jul 2004 02:07:46 -0700
Hi folks
i try to update a mssql-database using the following code
PreparedStatement prstmt=connection.prepareStatement("INSERT INTO
GCP_IMAGE VALUES(?,?,?,?,?,?,?,?");
prstmt.setLong(1,11);
prstmt.setInt(2,4);
prstmt.setBinaryStream(3,fis,(int)file.length());
//fis=FileInputStream
prstmt.setString(4,"11_DRAWING.jpg");
prstmt.setLong(5,file.length());
prstmt.setString(6,"image/pjpeg");
prstmt.setLong(7,1000);
prstmt.setLong(8,1000);
prstmt.execute();
running this code results in the following error:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC][SQLServer]Line 1: Incorrect syntax near '@P8'.
what is this error telling me?? how can i view the syntax of the
statement that is sent to the database to find the error?
best regards
- Next message: Gerd Nachtsheim: "Re: PreparedStatement.execute() failes..."
- Previous message: Claudio Alberto Andreoni: "Re: What about a new DB without SQL?"
- Next in thread: Gerd Nachtsheim: "Re: PreparedStatement.execute() failes..."
- Reply: Gerd Nachtsheim: "Re: PreparedStatement.execute() failes..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]