使用准备好的语句设置表名
[Microsoft][ODBC Microsoft Access Driver] Parameter 'Pa_RaM000' specified where a table name is required.private String query1 = "SELECT plantID, edrman, plant, vaxnode FROM [?]"; //?=datepublic Execute(String reportDate){ try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn = DriverManager.getConnection(Display.DB_MERC); PreparedStatement st = conn.prepareStatement(query1); st.setString(1, reportDate); ResultSet rs = st.executeQuery();
临摹微笑
FFIVE