Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Sql e tabelle

  1. #1

    Sql e tabelle

    Esiste un comando sql per ottenere l'eleco delle tabelle che compongono un archivio mdb? Grazie mille.

  2. #2
    Moderatore di Programmazione L'avatar di LeleFT
    Registrato dal
    Jun 2003
    Messaggi
    17,328
    Spulciando la documentazione Java ho trovato questo che potrebbe essere utile, come potrebbe essere assolutamente inutile o inutilizzabile:
    codice:
    Classe DatabaseMetaData:
    
    public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types)
    
    Retrieves a description of the tables available in the given catalog. Only table descriptions matching the catalog, schema, table name and type criteria are returned. They are ordered by TABLE_TYPE, TABLE_SCHEM and TABLE_NAME. 
    Each table description has the following columns: 
    
    1) TABLE_CAT String => table catalog (may be null) 
    2) TABLE_SCHEM String => table schema (may be null) 
    3) TABLE_NAME String => table name 
    4) TABLE_TYPE String => table type. Typical types are "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM". 
    5) REMARKS String => explanatory comment on the table 
    6) TYPE_CAT String => the types catalog (may be null) 
    7) TYPE_SCHEM String => the types schema (may be null) 
    8) TYPE_NAME String => type name (may be null) 
    9) SELF_REFERENCING_COL_NAME String => name of the designated "identifier" column of a typed table (may be null) 
    10) REF_GENERATION String => specifies how values in SELF_REFERENCING_COL_NAME are created. Values are "SYSTEM", "USER", "DERIVED". (may be null)
    un oggetto di questo tipo lo si può ricavare attraverso la Connection:
    codice:
    Connection db = DriverManager.getConnection(...);
    DatabaseMetaData dbmd = db.getMetaData();
    Se quel metodo dovesse funzionare, basterebbe passargli tutti i valori NULL in quanto non penso che Access utilizzi i Catalog. Sono sicuro che non usa gli Schema, quindi... prova un po' tu.


    Ciao.
    "Perchè spendere anche solo 5 dollari per un S.O., quando posso averne uno gratis e spendere quei 5 dollari per 5 bottiglie di birra?" [Jon "maddog" Hall]
    Fatti non foste a viver come bruti, ma per seguir virtute e canoscenza

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.