Skip to content

Latest commit

 

History

185 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

commonsMH - A superset for easy java tools and website developement

CodeFactor JitPack GitHub License

Table of Contents

  1. Database connection
  2. Flogger
  3. WebServer
  4. Router
  5. Route types
  6. RESTAPI route
  7. UploadHandler
  8. Authentication
  9. CacheTimers
  10. GETRequest
  11. Discord Webhook
  12. SitemapGenerator
  13. License

Database connection

Database database = new Database();
database.setDefaultSettings(); // Adds auto reconnect to mysql connections and cachePrepStmts
database.setMaximumPoolSize(30); // Sets the pool size
database.setConnectionTimeout(3000); // Set the timeout
// You will need to provide a own cfg before
database.connectToMySQL(CONFIG.getServerIp(), CONFIG.getMySQLUserName(), CONFIG.getMySQLPassword(), CONFIG.getMySQLDatabase(), ServerTimezone.UTC); // Connect the Instance to the Server

// You now can pull connections with:
MySQL myConnection = Database.getConnection(); // throws SQLException

myConnection.Query("SELECT * FROM `users` WHERE `id` = ?", 2); // prepStatements in one Line
myConnection.Exec("DELETE FROM `users` WHERE `id` = ?", 2);

// You will need to close this after you finish
myConnection.close();

// Many things in commonsMH will provide you with an connection that will automaticly close

License

This project is licensed under the MIT License.

About

A java web framework with Spark and Freemarker and many other Tools

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages