|
|
|
JDBC postgresql, Eclipse & AJAX
|
|||
|---|---|---|---|
|
#18+
Я сделал прогу package ru.cerif.client; import java.sql.SQLException; import org.postgresql.core.ConnectionFactory; import org.postgresql.core.ProtocolConnection; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Grid; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.SourcesTableEvents; import com.google.gwt.user.client.ui.TableListener; import com.google.gwt.user.client.ui.TextBox; /** * Entry point classes define <code>onModuleLoad()</code>. */ public class cerif implements EntryPoint { /** * This is the entry point method. */ private int old_row=-1,old_column=-1; private String data[][]; private void FillDataFromDatabase() throws SQLException { ProtocolConnection conn = ConnectionFactory.openConnection("localhost", 5432, "postgres", "12345", null); } public void onModuleLoad() { try { FillDataFromDatabase(); } catch(Exception ex) { Window.alert(ex.toString()); return; } final Grid myGrid = new Grid(); final TextBox box = new TextBox(); box.setWidth("137"); box.setHeight("20"); myGrid.setVisible(true); myGrid.setStyleName("table"); myGrid.resize(20, 5); myGrid.setBorderWidth(1); data = new String[19][5]; for (int i = 0; i < 5; i++) { myGrid.setText(0, i, "Header "+String.valueOf(i)); } for (int row = 0; row < 20; row++) for (int cell = 0; cell < 5; cell++) { myGrid.getCellFormatter().setHeight(row, cell, "24"); myGrid.getCellFormatter().setWidth(row, cell, "138"); if (row>0) { data[row-1][cell] = ""; } } myGrid.setHeight("500"); myGrid.setWidth("700"); myGrid.getAbsoluteLeft(); myGrid.setCellPadding(0); myGrid.setCellSpacing(0); myGrid.addTableListener( new TableListener(){ public void onCellClicked(SourcesTableEvents sender, int row, int cell) { if (row==0) { if (old_row > 0) { data[old_row-1][old_column] = box.getText(); if ( data[old_row-1][old_column] == "") myGrid.setText(old_row, old_column, " "); else myGrid.setText(old_row, old_column, data[old_row-1][old_column]); } return; } if (old_row > 0) { data[old_row-1][old_column] = box.getText(); if ( data[old_row-1][old_column] == "") myGrid.setText(old_row, old_column, " "); else myGrid.setText(old_row, old_column, data[old_row-1][old_column]); } myGrid.setWidget(row, cell, box); old_row = row; old_column = cell; box.setText(data[row-1][cell]); box.setFocus(true); } }); RootPanel.get("slot1").add(myGrid); RootPanel.get("slot1").setWidgetPosition(myGrid, 0, 0); } } я в eclipse подключил postgresql-8.1-407.jdbc3.jar, он видит эту библиотеку но когда я запускаю прогу мне пишет что Analyzing source in module 'ru.cerif.cerif' [ERROR] Errors in 'W:\home\test1.ru\src\ru\cerif\client\cerif.java' [ERROR] Line 4: The import java.sql cannot be resolved [ERROR] Line 6: The import org cannot be resolved [ERROR] Line 7: The import org cannot be resolved [ERROR] Line 26: SQLException cannot be resolved to a type [ERROR] Line 28: ProtocolConnection cannot be resolved to a type [ERROR] Line 28: ConnectionFactory cannot be resolved Finding entry point classes [ERROR] Unable to find type 'ru.cerif.client.cerif' [ERROR] Hint: Previous compiler errors may have made this type unavailable [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entri es properly [ERROR] Build failed кто может, подскажите в чем дело!!! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 26.07.2006, 13:39 |
|
||
|
|

start [/forum/topic.php?fid=59&msg=33879519&tid=2148585]: |
0ms |
get settings: |
8ms |
get forum list: |
16ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
169ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
53ms |
get tp. blocked users: |
1ms |
| others: | 254ms |
| total: | 518ms |

| 0 / 0 |
