We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use hikari datasource in MVC class
package app;
import io.jooby.Jooby; import io.jooby.hikari.HikariModule; import javax.sql.DataSource;
public class App extends Jooby {
{ install(new HikariModule()); mvc(new Usercontroller()); DataSource DS = require(DataSource.class); } public static void main(final String[] args) { runApp(args, App::new); }
}
import io.jooby.Jooby; import io.jooby.annotations.*; import io.jooby.MediaType; import io.jooby.Context;
@path("/api-v1") public class Usercontroller {
public String sayHi(Context ctx) { // want to use Hikari DataSource here ctx.setResponseCode(200); ctx.setResponseType(MediaType.json); String q = ctx.query("q").value(); return "{\"message\": \"Hello Raw Response" + q + "\"}"; } @Path("/pvc") @GET public String sayHi2(Context ctx) { //ctx.setResponseCode(401); ctx.setResponseType(MediaType.json); return "{\"message\": \"Hello PVC Response\"}"; }
No documentation found, plz help
The text was updated successfully, but these errors were encountered:
Hi:
public String sayHi(Context ctx) { // want to use Hikari DataSource here DataSource ds = ctx.require(DataSource.class); ctx.setResponseCode(200); ctx.setResponseType(MediaType.json); String q = ctx.query("q").value(); return "{\"message\": \"Hello Raw Response" + q + "\"}"; }
Sorry, something went wrong.
No branches or pull requests
How to use hikari datasource in MVC class
File: App.java
package app;
import io.jooby.Jooby;
import io.jooby.hikari.HikariModule;
import javax.sql.DataSource;
public class App extends Jooby {
}
File: Usercontroller.java
package app;
import io.jooby.Jooby;
import io.jooby.annotations.*;
import io.jooby.MediaType;
import io.jooby.Context;
@path("/api-v1")
public class Usercontroller {
}
No documentation found, plz help
The text was updated successfully, but these errors were encountered: