Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Tabellen anzeigen lassen

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich fasse mich auch kurz :-)

Wie kann ich mir denn alle Tabellen einer Access-Datenbank anzeigen lassen?

thx

Mit nem echt langem select Statement :D

Hi,

nach dem tollen Statement meines Vorredners kann ich Dir ein paar meiner "Erfahrungen" mitgeben, die allerdings nicht direkt zu Access passen, weil ich damit nie arbeite...

Also ich würde erstmal einen Select auf eine der Systemtabellen machen (unter Oracle oder MySQL z.b.), daher bekomme ich dann alle Tabellen, die es so gibt.

Diese würde ich dann in einer Schleife nach und nach erstmal nach ihren Spaltennamen und Typen abfragen und dann einen select * from foo machen.

Das nur so als Idee. Vielleicht hiilft es Dir ja weiter...

Greetz Markus

Ok, dank an alle.

Dann weis ich ja jetzt, wo ich anfangen kann um mich ein wenig schlauer zu machen :-)

MfG

OD

Hallo,

das hier ist eine Klasse zur Erzeugung einer HTML Tabelle aus einem Resultset unter Verwendung von ResultSetMetaData.

um die einzelnen Tabellen einer Datenbank musst du dich selber kümmern.

Gruß Jaraz

---------------------------------------------------------

import java.sql.*;

public class HtmlResultSet {

private ResultSet rs;

public HtmlResultSet(ResultSet rs) {

this.rs = rs;

}

public String toString() { // can be called at most once

StringBuffer out = new StringBuffer();

// Start a table to display the result set

out.append("<TABLE>\n");

try {

ResultSetMetaData rsmd = rs.getMetaData();

int numcols = rsmd.getColumnCount();

// Title the table with the result set's column labels

out.append("<TR>");

for (int i = 1; i <= numcols; i++) {

out.append("<TH>" + rsmd.getColumnLabel(i));

}

out.append("</TR>\n");

while(rs.next()) {

out.append("<TR>"); // start a new row

for (int i = 1; i <= numcols; i++) {

out.append("<TD>"); // start a new data element

Object obj = rs.getObject(i);

if (obj != null)

out.append(obj.toString());

else

out.append(" ");

}

out.append("</TR>\n");

}

// End the table

out.append("</TABLE>\n");

}

catch (SQLException e) {

out.append("</TABLE><H1>ERROR:</H1> " + e.getMessage() + "\n");

}

return out.toString();

}

}

-----------------------------------------------------

Quelle: Java Servlet Programmierung von Jason Hunter, O'Reilly

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.