[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3824: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3826: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3827: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3828: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
Next Framework • Ver Tópico - Carregar tabelas do banco com o Next
Página 1 de 1

Carregar tabelas do banco com o Next

MensagemEnviado: Qua Mar 26, 2014 9:29 am
por gbrezolini
Bom dia pessoal, alguém sabe me dizer como faço para retornar as tabelas do banco de dados utilizando o Next sem o uso de jdbc.

Re: Carregar tabelas do banco com o Next

MensagemEnviado: Qua Mar 26, 2014 9:59 pm
por rogelgarcia
Olá gbrezolini,

As tabelas estão descritas no banco de dados. A forma de comunicação com o banco de dados em java é por jdbc. Logo, não é possível fazer isso que está querendo.

Explique melhor seu problema, que talvez exista uma solução.

Re: Carregar tabelas do banco com o Next

MensagemEnviado: Qui Mar 27, 2014 9:18 am
por gbrezolini
Oi rogelgarcia, o meu problema é o seguinte: Atualmente uso a JDBC para retornar as tabelas existentes no meu banco de dados, e mostro a lista dessas tabelas em uma combo, até aí tá funcionando beleza, só que eu preciso saber se existe uma forma de fazer a mesma coisa com a framework do Next.
Esse é o método que uso para retornar uma lista com as tabelas, então eu preciso fazer o mesmo no Next.

public static List<String> retornaTabelas(DataSource dataSource) throws Exception {
List<String> retorno = new ArrayList<String>();

String[] tableTypes = { "TABLE" };
Connection con = null;
ResultSet resultSet = null;
try {
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
con = jdbcTemplate.getDataSource().getConnection();
DatabaseMetaData databaseMetaData = con.getMetaData();
resultSet = databaseMetaData.getTables(null, null, "%", tableTypes);
while (resultSet.next()) {
retorno.add(resultSet.getString(3));
}

} catch (Exception e) {
} finally {
resultSet.close();
con.close();
}

return retorno;
}

Re: Carregar tabelas do banco com o Next

MensagemEnviado: Sex Abr 04, 2014 7:20 pm
por rogelgarcia