Sequence |
Wie bekomme ich eine Sequencenummer ? |
How I get a sequencenumber? |
1) create sequence "seqname" 2) create a table sequenz (pindex as integer) 3) insert ONE tupel pindex=1 4) SELECT NEXT VALUE FOR "+seqname+" FROM Sequenz; here you see, why you need a separat table 5) get the number from the returnvalues
Better, if you convert the returnvalues to the class datatable à la C#
Quellcode: sequence.txt |
getTables |
Wie bekomme ich die Tabellen? |
How I get the Entities/Tables? |
tables:
String[] TABLE_TYPES = {"TABLE"} DatabaseMetaData dbmd = conn.getMetaData(); rs = dbmd.getTables(null, null, null, TABLE_TYPES); while (rs.next()) { tables.add( rs.getString(TABLE_NAME) ); }
Quellcode: tables_columns.txt |
getColumns |
Wie bekomme ich die Spalten einer Tabelle? |
How I get the columns of a table? |
Columns:
SELECT column_name, Data_type FROM INFORMATION_SCHEMA.COLUMNS where table_name='"+ tablename+"' ";
Quellcode: tables_columns.txt |
dbsConsole |
Ich benötige eine DBS-Cosnole in meinem Programm |
I need a DBSComnsole in my program. |
in my JDialog "FDBSConsole.java" you get an two list for the tables and columns and an editor for the sql-input, and a jtable for the results.
Quellcode: FDBSConsole.java
see samples 3: Hsql_Bsp3.zip |