|
|
|
Помогите разобраться
|
|||
|---|---|---|---|
|
#18+
этот примерчик я взял с интернета вызываю http://hp530:8080/sample/StaffByJSPDirect.jsp не отвечает!!! Оракл 10 -ка, на локальном компе,порт 1521! Нормально соединяюсь через Sqlplus <%@ page import="java.sql.*" %> <html> <head><title>Direct JDBC Query JSP</title></head> <body> <h3>JSP StaffByJSPDirect result:</h3> <pre> <%= StaffByJSPDirect() %> </pre> <hr> </body> </html> <%! private String StaffByJSPDirect() throws SQLException { Connection cn = null; StringBuffer sb = new StringBuffer(); try { cn = DriverManager.getConnection( "jdbc:oracle:thin:@localhost:1521:myfcc", "scott", "tiger"); } catch (SQLException e) { }; Statement st = null; ResultSet rs = null; try { st = cn.createStatement(); rs = st.executeQuery("SELECT empno, ename FROM emp"); while (rs.next()) { sb.append("Number=" + rs.getString(1) + " " + "Name=" + rs.getString(2) + "\n"); }; cn.close(); } catch (SQLException e) { }; return sb.toString(); } %> ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.09.2008, 10:51 |
|
||
|
|

start [/forum/topic.php?fid=22&fpage=321&tid=1455926]: |
0ms |
get settings: |
11ms |
get forum list: |
16ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
37ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
21ms |
get tp. blocked users: |
1ms |
| others: | 248ms |
| total: | 351ms |

| 0 / 0 |
