Database 雪花JDBC程序失败 私有静态连接getConnection() 抛出SQLException{ 试一试{ 类.forName(“net.snowflake.client.jdbc.SnowflakeDriver”); }捕获(ClassNotFoundException ex){ System.err.println(“未找到驱动程序”); } //生成连接属性 属性=新属性(); properties.put(“用户”、“用户”);//将“”替换为您的用户名 properties.put(“password”、“######”);//将“”替换为您的密码 properties.put(“account”,“ina88167.us-east-1”);//将“”替换为您的帐户名 properties.put(“db”、“DEMO_db”);//将“”替换为目标数据库名称 properties.put(“仓库”、“我的仓库”);//将“”替换为目标仓库名称 properties.put(“schema”、“PUBLIC”);//将“”替换为目标架构名称 //出售(“追踪”、“开启”); //创建新连接 String connectStr=System.getenv(“SF_JDBC_CONNECT_String”); //如果未在环境中设置默认连接字符串,请使用该字符串 if(connectStr==null){ connectStr=“jdbc:snowflake://ina88167.us-east-1.snowflakecomputing.com/“;//用您的帐户名替换accountName } 返回DriverManager.getConnection(connectStr,properties); }

Database 雪花JDBC程序失败 私有静态连接getConnection() 抛出SQLException{ 试一试{ 类.forName(“net.snowflake.client.jdbc.SnowflakeDriver”); }捕获(ClassNotFoundException ex){ System.err.println(“未找到驱动程序”); } //生成连接属性 属性=新属性(); properties.put(“用户”、“用户”);//将“”替换为您的用户名 properties.put(“password”、“######”);//将“”替换为您的密码 properties.put(“account”,“ina88167.us-east-1”);//将“”替换为您的帐户名 properties.put(“db”、“DEMO_db”);//将“”替换为目标数据库名称 properties.put(“仓库”、“我的仓库”);//将“”替换为目标仓库名称 properties.put(“schema”、“PUBLIC”);//将“”替换为目标架构名称 //出售(“追踪”、“开启”); //创建新连接 String connectStr=System.getenv(“SF_JDBC_CONNECT_String”); //如果未在环境中设置默认连接字符串,请使用该字符串 if(connectStr==null){ connectStr=“jdbc:snowflake://ina88167.us-east-1.snowflakecomputing.com/“;//用您的帐户名替换accountName } 返回DriverManager.getConnection(connectStr,properties); },database,jdbc,snowflake-cloud-data-platform,Database,Jdbc,Snowflake Cloud Data Platform,getconnection提供“无效用户名或密码”请将属性与帐户一起更改为该属性,您应该可以: properties.put("account", "ina88167"); // replace "" with your account name 你介意重新格式化吗?我抄到了记事本上,但换行符没有正确通过。

getconnection提供“无效用户名或密码”

请将属性与帐户一起更改为该属性,您应该可以:

properties.put("account", "ina88167"); // replace "" with your account name

你介意重新格式化吗?我抄到了记事本上,但换行符没有正确通过。