run_sql_common | R Documentation |
定义数据库连接的处理逻辑
run_sql_common(id)
id |
内码 |
返回值
library(shiny)
library(tsui);
ui <- fluidPage(
titlePanel("SQL SERVER 数据库连接信息测试"),
sidebarLayout(
sidebarPanel(
mdl_sql_conn('sql')
),
mainPanel(
mdl_dataTable('select')
)
)
)
server <- function(input, output) {
con <- run_sql_common('sql');
data <- reactive(
{
res <- RJDBC::dbGetQuery(con(),'select top 100 * from T_GL_VOUCHER;')
return(res)
}
)
run_dataTable(proc_dataTable,id = 'select',data=data())
}
# Run the application
shinyApp(ui = ui, server = server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.