[英]SQL Connection error in Bluemix:Exception thrown by application class 'com.ibm.db2.jcc.am.fd.a:679'
Error details Please find the linked image for the error details while connecting SQL DB in Blue mix错误详细信息请在 Blue mix 中连接 SQL DB 时找到错误详细信息的链接图像
Please find the below sample code请找到以下示例代码
<%@ page import="java.sql.*"%> <%@ page import="com.ibm.db2.jcc.DB2SimpleDataSource"%>
String username = request.getParameter("username");
String password = request.getParameter("password"); Connection con=null; DB2SimpleDataSource dataSource = new DB2SimpleDataSource(); String databaseHost="75.126.155.153"; int port=50000; String databaseName="SQLDB"; String user="*****"; String pword="*****"; dataSource.setServerName(databaseHost); dataSource.setPortNumber(port); dataSource.setDatabaseName(databaseName); dataSource.setUser(user); dataSource.setPassword (pword); dataSource.setDriverType(4); con=dataSource.getConnection();
The SQLCODE -204 means "Undefined name". SQLCODE -204 表示“未定义名称”。 It is a DB2 error code indicating 'object does not exist'.这是一个指示“对象不存在”的 DB2 错误代码。 The SQLERRMC value helps provides you more specific information. SQLERRMC 值有助于为您提供更具体的信息。 In your case what can't be found is the table USER14336.DDP_DIR .在您的情况下,找不到表USER14336.DDP_DIR 。 Double check the schema name ( USER14336 ) and the table name ( DDP_DIR ).仔细检查架构名称 ( USER14336 ) 和表名称 ( DDP_DIR )。 Please check also the VCAP_SERVICES environment variable of your application to see if you are using the correct username (as schema name).另请检查您的应用程序的 VCAP_SERVICES 环境变量,以查看您是否使用了正确的用户名(作为架构名称)。 You can also omit the schema name if there is only one (in this case DB2 uses the default one).如果只有一个模式名称,您也可以省略模式名称(在这种情况下,DB2 使用默认名称)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.