|
|
|
Ошибка при выполнении запроса
|
|||
|---|---|---|---|
|
#18+
при выполнении PreparedStatement stmt = conn.prepareStatement("select * from table_name"); rs = stmt.executeQuery(); выдает ошибку java.io.IOException: Stream closed ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.11.2005, 18:07 |
|
||
|
Ошибка при выполнении запроса
|
|||
|---|---|---|---|
|
#18+
Весь код плз ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.11.2005, 18:15 |
|
||
|
Ошибка при выполнении запроса
|
|||
|---|---|---|---|
|
#18+
import java.sql.*; import java.io.*; public static void Wellcome_run(Connection conn) { String result = null; ResultSet rs = null; try{ Class.forName("org.postgresql.Driver"); }catch (ClassNotFoundException e) { e.printStackTrace(); } try{ PreparedStatement stmt = conn.prepareStatement("select * from official_position"); try{ rs = stmt.executeQuery(); }catch (SQLException e){ e.printStackTrace(); } while (rs.next()) { for (int i=1; i <=1; i++){ result = rs.getString(i); System.out.println(result); } } } }catch (SQLException e) { System.out.println(e); } } } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.11.2005, 18:23 |
|
||
|
Ошибка при выполнении запроса
|
|||
|---|---|---|---|
|
#18+
это весь-весь код или только его часть? ----------------------------------- The Bat + My Gate Posted via ActualForum NNTP Server 1.3 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.11.2005, 18:32 |
|
||
|
Ошибка при выполнении запроса
|
|||
|---|---|---|---|
|
#18+
почти весь за исключением public class Welcome и public void Welcome(){ } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.11.2005, 18:40 |
|
||
|
Ошибка при выполнении запроса
|
|||
|---|---|---|---|
|
#18+
Код: plaintext 1. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.11.2005, 18:55 |
|
||
|
Ошибка при выполнении запроса
|
|||
|---|---|---|---|
|
#18+
import java.io.*; import java.sql.*; public class DBTest { public static void main(String[] args){ // Создаем загрузчик try{ Class.forName("org.postgresql.Driver"); }catch (ClassNotFoundException e) { e.printStackTrace(); } try{ Connection conn = DriverManager.getConnection( "jdbc:postgresql://127.0.0.1:5432/db", "user", "pass"); try{ sqlClassLoader sql = new sqlClassLoader(); sql.setConnection(conn); // Загружаем класс Class Welcome = sql.loadClass("Welcome"); // Создаем экземпляр класса try{ Object instance = Welcome.newInstance(); Welcome wel = new Welcome(); wel.Wellcome_run(conn); }catch(InstantiationException e){ e.printStackTrace(); } catch(IllegalAccessException e){e.printStackTrace(); } }catch(ClassNotFoundException e){System.out.println("error"); } }catch (SQLException e) { e.printStackTrace(); } } } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.11.2005, 18:58 |
|
||
|
|

start [/forum/topic.php?fid=59&msg=33367413&tid=2151027]: |
0ms |
get settings: |
9ms |
get forum list: |
19ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
186ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
48ms |
get tp. blocked users: |
2ms |
| others: | 214ms |
| total: | 497ms |

| 0 / 0 |
