("Connecting to database.") Ĭlass.forName(".jdbc.Driver") Ĭonnection = DriverManager. This way we can just focus on database query we are interested in. The reason we use Spring’s JdbcTemplate is that it take cares of opening, and closing of Statements, connections, and exception handling. I'm trying to connect my Java Maven project (which runs on a Jetty server) to a Google Cloud MySQL Database with the following code: private static final String CREDENTIALS_STRING = "jdbc::mysql://google/weatherplanning?cloudSqlInstance=csci310-project-2:us-central1:myinstance&socketFactory=.mysql.SocketFactory&useSSL=false&user=xxxx&password=xxxx" root-content.xml is where we utilize the to connect to the database.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |