Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Programmer > work with sybas...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 52683 of 53515
Post > Topic >>

work with sybase...

by Bumsys@[EMAIL PROTECTED] May 13, 2008 at 03:16 AM

I run sql query:
public final void insertFileSybase(final int id, final String folder,
            final String filename, final File file, final boolean
isPacked,
            final Timestamp lastModified, final Timestamp lastWritten,
            final String checkSum, final int backupNo, final int type,
            final boolean isDeleted, final int clientId)
            throws SQLException, IOException {
        // TODO checksum is null
        boolean isAUResChecksumColumnExist =
manager.getConnectionInfo()
                .isAUResChecksumColumnExist();

        int deleted = isDeleted ? 1 : 0;

        String query = null;
        if (isAUResChecksumColumnExist) {
            query = "insert into "
                    + getFullTableName(Tables.RESOURCE)
                    + " (application_id, backupno, path, name,
contents, last_written, last_modified, packed, checksum, type,
deleted, client_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
        } else {
            query = "insert into "
                    + getFullTableName(Tables.RESOURCE)
                    + " (application_id, backupno, path, name,
contents, last_written, last_modified, packed, type, deleted,
client_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
        }
        logQuery(query);
        logQueryParameter("application_id = " + id);
        logQueryParameter("backupno = " + backupNo);
        logQueryParameter("path = " + makePathToDB(folder));
        logQueryParameter("name = " + filename);
        logQueryParameter("last_written = " + lastWritten);
        logQueryParameter("last_modified = " + lastModified);
        logQueryParameter("packed = " + (isPacked ? 1 : 0));
        if (isAUResChecksumColumnExist) {
            logQueryParameter("checkSum = " + checkSum);
        }
        logQueryParameter("type = " + type);
        logQueryParameter("deleted = " + deleted);
        logQueryParameter("client_id = " + clientId);
        PreparedStatement ps =
manager.getConnection().prepareStatement(query);
        ps.setInt(1, id);
        ps.setInt(2, backupNo);
        ps.setString(3, makePathToDB(folder));
        ps.setString(4, filename);

        // TODO long
        int len = (int) file.length();
        log.info("file: " + file.getAbsolutePath());
        if (isDeleted && !file.exists()) {
            ps.setNull(5, Types.LONGVARBINARY);
        } else if (file.exists() && len == 0) {
            ps.setNull(5, Types.LONGVARBINARY);
        } else {
            InputStream in = new FileInputStream(file);
            ps.setBinaryStream(5, in, len);
        }

        ps.setTimestamp(6, lastWritten);
        ps.setTimestamp(7, lastModified);
        ps.setInt(8, isPacked ? 1 : 0);
        if (isAUResChecksumColumnExist) {
            ps.setString(9, checkSum);
        }
        int typeNumber = isAUResChecksumColumnExist ? 10 : 9;
        ps.setInt(typeNumber, type);
        int deletedNumber = isAUResChecksumColumnExist ? 11 : 10;
        ps.setInt(deletedNumber, deleted);
        int clientIdNumber = isAUResChecksumColumnExist ? 12 : 11;
        ps.setInt(clientIdNumber, clientId);

        int numberOfRows = ps.executeUpdate();
        logNumberOfRows(numberOfRows);
        ps.close();
    }

and when run ps.executeUpdate(), i.e. run sql query and then I have
error: There is not enough procedure cache to run this procedure,
trigger, or
SQL batch. Retry later, or ask your SA to reconfigure ASE with more
procedure cache.
What can do that to solve this problem?
 




 3 Posts in Topic:
work with sybase...
Bumsys@[EMAIL PROTECTED]   2008-05-13 03:16:47 
Re: work with sybase...
Tim Slattery <Slattery  2008-05-13 16:12:40 
Re: work with sybase...
=?ISO-8859-1?Q?Arne_Vajh=  2008-05-14 20:09:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 7:36:17 CDT 2008.