Error: JDBC News NullpointerException and Oracle News ORA-00936 Error

zhaozj2021-02-16  88

My program is as follows, / ** Database Access package class.

* To change the template for this generated file go to * Window> Preferences> Java> Code Generation> Code and Comments * / package com.youcompany.struts.action; import java.sql *;. Public class QueryFromDB {/ *** table and column names with the table name select statement configured * @param colName * @param tableName * @ return * @throws ArrayIndexOutOfBoundsException * / public String ConstructQuery (String tableName, String [] colName) throws ArrayIndexOutOfBoundsException {String str = "select"; for (INT i = 0; i Preferences> Java> Code Generation> Code and Comments * / public class ConnectToDB {public ConnectToDB. () {} public static Connection getConn () throws ClassNotFoundException, SQLException {Class.forName ( "oracle.jdbc.driver.OracleDriver"); Connection connt = DriverManager.getConnection ( "jdbc: oracle: thin: @ 10.10.11.144: 1521 : EDU "," Study1 "," Study1 "); Return ConNT;

转载请注明原文地址:https://www.9cbs.com/read-12849.html

New Post(0)