powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Java [игнор отключен] [закрыт для гостей] / Как понять, где ошибка в java-классе?
2 сообщений из 2, страница 1 из 1
Как понять, где ошибка в java-классе?
    #39405131
Фотография Pastic
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Есть такой класс в СУБД Oracle 11 (JDK 1.5.0_10):

Код: java
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
create or replace and compile java source named "UpLoadFiles" as
import java.io.*;
import java.sql.*;

  public class UpLoadFiles
  {
    public static void InsertFiles(String directory) throws IOException, SQLException
    {  File path=new File(directory);
       if (!path.exists()) throw new IOException("Каталог '"+directory+"' не найден.");
       String[] list=path.list();
       String element;
       int n;
       for(int i=0; i<list.length; i++)
       {  element=list[i];
          try
          {  FileInputStream fi=new FileInputStream(element);
             n=fi.available();
             StringBuffer FileContent=new StringBuffer(n);
             for(int j=0; j<n; j++)
             {  FileContent.append((char) fi.read());
             }
             #sql { INSERT INTO DUBP_ADVICE_FILES(FILE_NAME, FILE_CONTENT)
                    VALUES (:element, :FileContent) };
          }
          catch(IOException e)
            { throw new IOException("I/O error: "+e+" "+e.getCause()); }
          catch(SQLException e)
            { throw new SQLException("SQL error: "+e+" "+e.getCause()); }
          finally
          {  try
               { fi.close(); }
             catch(IOException e)
               { throw new IOException("I/O error: "+e+" "+e.getCause()); }
             catch(SQLException e)
               { throw new SQLException("SQL error: "+e+" "+e.getCause()); }
          }
       }
    }
  }



После его компиляции в PL/SQL Developer'e появляется сообщение "Compiled with errors", а сам класс в ветках "Java classes" и "Java sources" в PL/SQL Developer'e помечен как ошибочный.

Я открывал текст этого класса в JDeveloper, и он не показал наличия каких-либо ошибок.

Как узнать, где ошибка?
...
Рейтинг: 0 / 0
Как понять, где ошибка в java-классе?
    #39405710
Darrko
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Pastic,

Добрый день.

Это вопрос скорее в конференцию по Oracle.

После компиляции ошибки можно посмотреть с помощью запроса:
Код: plsql
1.
select * from user_errors where name = 'UpLoadFiles' order by sequence;



В Вашем случае ошибка:
UpLoadFiles:21: Unsupported Java type for host item FileContent (at position #2): java.lang.StringBuffer.

Unsupported Java type for host item name (at position #n): type.
Cause: The Java type type is not supported as a host item by your JDBC driver.
Action: Use a different Java type in your host expression. Possibly update your JDBC driver.
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / Java [игнор отключен] [закрыт для гостей] / Как понять, где ошибка в java-классе?
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]