我在一个名为output的桶中命名了一个文件夹BucketA.我有一个文件output夹列表.如何使用AWS Java SDK将它们下载到本地计算机?
以下是我的代码:
AmazonS3Client s3Client = new AmazonS3Client(credentials);
File localFile = new File("/home/abc/Desktop/AmazonS3/");
s3Client.getObject(new GetObjectRequest("bucketA", "/bucketA/output/"), localFile);
Run Code Online (Sandbox Code Playgroud)
我收到了错误:
AmazonS3Exception: The specified key does not exist.
Run Code Online (Sandbox Code Playgroud) 我想在用户从下拉菜单中选择时运行sql语句.
我的HTML:
<form action="listKeyword.jsp">
<select name="item">
<option value="buy">Buy</option>
<option value="hold">Hold</option>
<option value="good">Good</option>
<option value="sell">Sell</option>
</select>
<input type="submit" value="Submit">
</form>
Run Code Online (Sandbox Code Playgroud)
我的JSP代码:
<%
Dbase db = new Dbase();
Connection conn = db.connect("jdbc:mysql://localhost:3306/fyp", "root", "");
ResultSet rs;
Statement stmt = conn.createStatement();
String keyword = request.getParameter("item");
//out.println(keyword);
if(keyword == "buy"){
out.println("buy statement");
String query = "select numberofoccurence from stock WHERE name='buy';";
rs = stmt.executeQuery(query) ;
while(rs.next()){
System.out.println(rs.getString(1));
}
}else if(keyword == "sell"){
String query = "select numberofoccurence from stock WHERE name='sell';";
rs = stmt.executeQuery(query) …Run Code Online (Sandbox Code Playgroud) 我目前正在关注本网站的教程:http : //www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
我可以从 firebase 控制台发送通知,但无法从 PHP 发送通知。
config_firebase.php
<?php
// Firebase API Key
define('FIREBASE_API_KEY', 'xxx');
?>
Run Code Online (Sandbox Code Playgroud)
push_firebase.php
<?php
class Push {
// push message title
private $title;
private $message;
private $image;
// push message payload
private $data;
// flag indicating whether to show the push
// notification or not
// this flag will be useful when perform some opertation
// in background when push is recevied
private $is_background;
function __construct() {
}
public function setTitle($title) {
$this->title = …Run Code Online (Sandbox Code Playgroud) app.js
var app = express();
app.listen(PORT, () => console.log(`Listening on ${ PORT }`));
// all environments
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use(session({
secret: 'keyboard cat',
resave: true,
saveUninitialized: false,
// cookie: {
// maxAge: 365 * 24 * 60 * 60 * 1000,
// path : '/'
// }
}));
app.use('/portal/admin', adminRouter);
app.use('/portal/merchant', indexRouter);
app.use('/users', usersRouter);
app.use('/api/v1/users',apiRouter);
app.use('/api/v1/users',customerInstallmentAPIRouter);
app.use('/api/v1/payment',paymentMethodAPIRouter);
// catch …Run Code Online (Sandbox Code Playgroud)