mardi 13 mai 2014

Java - se connecter à votre Instance de DB de RDS - Stack Overflow


Hi after connecting to my RDS DB instance, how do I connect to it via Eclipse and create tables on my database (using Java code not Eclipse API).


CreateDBInstanceRequest createDBInstanceRequest = new CreateDBInstanceRequest()
.withEngine("MySQL")
.withLicenseModel("general-public-license")
.withEngineVersion("5.6.13")
.withDBInstanceClass("db.t1.micro")
.withMultiAZ(false)
.withAutoMinorVersionUpgrade(true)
.withAllocatedStorage(5)
.withDBInstanceIdentifier("mydbinstance")
.withMasterUsername("master")
.withMasterUserPassword("password")
.withDBName("dbname")
.withPort(3306);

DBInstance dbInstance = rds.createDBInstance(createDBInstanceRequest);

DescribeDBInstancesRequest instRequest = new DescribeDBInstancesRequest();
DescribeDBInstancesResult instResult = new DescribeDBInstancesResult();
Endpoint e = dbInstance.getEndpoint();

Do I need to download mySQL connector?




You might try this guide that shows you how to connect to the instance with Eclipse once it has been instantiated - http://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/tke_rds.html



Hi after connecting to my RDS DB instance, how do I connect to it via Eclipse and create tables on my database (using Java code not Eclipse API).


CreateDBInstanceRequest createDBInstanceRequest = new CreateDBInstanceRequest()
.withEngine("MySQL")
.withLicenseModel("general-public-license")
.withEngineVersion("5.6.13")
.withDBInstanceClass("db.t1.micro")
.withMultiAZ(false)
.withAutoMinorVersionUpgrade(true)
.withAllocatedStorage(5)
.withDBInstanceIdentifier("mydbinstance")
.withMasterUsername("master")
.withMasterUserPassword("password")
.withDBName("dbname")
.withPort(3306);

DBInstance dbInstance = rds.createDBInstance(createDBInstanceRequest);

DescribeDBInstancesRequest instRequest = new DescribeDBInstancesRequest();
DescribeDBInstancesResult instResult = new DescribeDBInstancesResult();
Endpoint e = dbInstance.getEndpoint();

Do I need to download mySQL connector?



You might try this guide that shows you how to connect to the instance with Eclipse once it has been instantiated - http://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/tke_rds.html


0 commentaires:

Enregistrer un commentaire