|
|
|
Properties для DriverManager
|
|||
|---|---|---|---|
|
#18+
Метод executeQuery срывается с ошибкой ORA-00600 том случае, если среди заданных в SQL-запросе полей имеются поля типа CHAR (если все поля number, то все нормально). Подозреваю что в Properties надо надо каким-то образом указать кодироваку символов. Пожалуста подскажите эти "волшебные слова". try { Class.forName("oracle.jdbc.driver.OracleDriver"); } catch (ClassNotFoundException e) { e.printStackTrace(); } String conn_str = "jdbc:oracle:thin:@" + "(description = " + " (address = (protocol = tcp)(host = XX.X.XX)(port = XXXX)) " + " (connect_data = " + " (SID = XXXX) " + " ) " + " )"; Properties props = new Properties(); props.setProperty("user", "XXXX"); props.setProperty("password", "XXXX"); try { Connection conn = DriverManager.getConnection(conn_str,props); PreparedStatement stat = conn.prepareStatement(" select field_1,field_2 from test_table "); ResultSet theSet = stat. executeQuery ( ); while ( theSet.next() ) { System.out.println( Integer.toString(theSet.getInt("field_1")) ); } } catch (SQLException ex) { System.out.println("SQLException" ); ex.printStackTrace(); } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.11.2007, 09:48:33 |
|
||
|
|

start [/forum/topic.php?fid=59&fpage=596&tid=2144040]: |
0ms |
get settings: |
18ms |
get forum list: |
31ms |
check forum access: |
8ms |
check topic access: |
8ms |
track hit: |
296ms |
get topic data: |
21ms |
get forum data: |
6ms |
get page messages: |
71ms |
get tp. blocked users: |
3ms |
| others: | 393ms |
| total: | 855ms |

| 0 / 0 |
