Developing a Java web service using Jersey(JAX-RS), mySQL and Eclipse - mysql

I have successfully created Web Services from MySQL Database using Netbeans tutorial. However, I would like to develop similar web services using Eclipse IDE. Why Eclipse IDE? There are two reasons for that:
1) This is because i am using Tomcat 7.0 and JEE6. Unfortunately, NetBeans 7.0.1 implements Facade design pattern while using their “Create Web services from Database …” Wizard and it does not have a plugin for Tomcat 7 and EE6.
2) The NetBeans Wizard is helpful but does not help me understand details about using JDBC bridge, managing connections to MySQL DB and creating services to access the DB. Additionally, i want to add authorization for my services so that only registered users will be able to access my web services.

There's a very clear tutorial for building JAX-RS services in the Jersey user guide.

I found this tutorial that contains Restful web services using java and mysql in eclipse. It might be what you were looking for though it is a very simple tutorial. Check it out.
http://www.techpages.org/webservice/simple-restful-web-services-using-java-and-mysql-example/2009/

Related

SQL adapter in Worlight?

I am new to IBM Worklight,and i found a way to connect to the MySQL using the SQL adapter.
the configuration as below:
<dataSourceDefinition>
<driverClass>com.mysql.jdbc.Driver</driverClass>
<url>jdbc:mysql://localhost:3306/worklight_training</url>
<user>Worklight</user>
<password>Worklight</password>
</dataSourceDefinition>
Since the adapter are compile together with the app, just wondering, is it safe? is there a possibility of someone decompiling my apk or ipa to view the adapter connection thus acquire the user and password to my mysql database.
A hacker decompiling your .apk or .ipa file will not find the database username/password there, for the simple reason that the adapter is not compiled "together with the app" and is not part of any artifacts that you install in a device.
An adapter is a server-side entity, not client-side.
The adapter is an object stored in the memory of the running application server.
Adapters are Server side code andare not part of the apk or ipa files.
You can check/confirm this information in Worklight documentation. The details about adapters, under "Developing the server side of a Worklight Application" are at:
http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.dev.doc/devref/c_overview_of_ibm_worklight_adap.html
You can also check the Server Side Development of MobileFirst Platform Getting Started Modules
https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-6-3/server-side-development/
(MobileFirst Platform is the new name of Worklight)
In worklight, you usually have the application (apk/ipa) communicating with a server side component (the adapters) running in a worklight server. The adapters are used to communicate with backend systems (like a mysql server). There are a few different types of adapters to communicate with different types of backends (like sql, http and SAP)
Please, let us know what documentation/guide caused you the understanding that adapters are part of the client apk/ipa. If that is really stated in any documentation, it is wrong and must be corrected.
Edit:
To connect to a MySQL DB (no matter if it is a standalone MySQL or in XAMP, LAMP or whatever package) you can follow this geting started tutorial
https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-6-3/server-side-development/sql-adapter-communicating-sql-database/
Also note that, if you are using MobileFirst Studio (previously Worklight Studio) downloaded for free from Developer Works you have a developer version of the WOrklight Server running inside Studio so that you can create and deploy adapters and use it during development as your server. But when you go to production you are required to purchase licenses of Worklight because you don't have the worklight server available for free.
So if you have Studio, you have the server available but only for development purposes.

How to publish a asp.net application with mysql

I'm developing a web application using asp.net and mysql. When i run it using visual studio it works fine. But when i'm trying to publish it following errors are coming.Please guide me what to do.
Message in Settings tab:
The database provider is not specified for this connection string. Incremental database publishing is supported only for SqlClient as well as Entity Framework code First models.

cas jasig using oracle data source on windows

is there any way that can help cas settings to use the data source oracle on windows
in my company will apply singgle singgle sign on and logout, I've been trying for 5 days, and until now have not been successful.
I've tried several ways
I use
Tomcat 7.0
Java 1.7
cas server 3.5.2
Tomcat 7.0
Java 1.7
cas server 3.5.2
I downloaded cas server 3.5.2
extract cas-server-3.5.2
copy cas-server-webapp-3.5.2.war into tomcat webapps
cas has been successfully deployed, and can be accessed
and then I do not understand anymore, how do I get the authentication process can use oracle database
sorry my english is not good
thank you
There's a few things you need to do:
First of all, if you haven't downloaded and included the Oracle JDBC Driver library (http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html) then you have to do that.
Secondly, you need to configure the JDBC plugin: https://wiki.jasig.org/display/CASUM/JDBC
These instructions (and the preferred method of customizing & building CAS) uses the Maven Web Overlay method. This has the advantage that you deploy lots of un-necessary libraries that you aren't using.

Connecting Web API to SQL server 2008

I am fairly new to .net MVC 4 and WEB API. I need to connect my web API to SQL server 2008 but I'm not sure how exactly. I'll I have seen is examples using the local DB and I can't seem to find my solution.
You might also want to check out this blog post by Jason Zander. He includes a very nice step-by-step walkthrough of building a simple Tourist Attraction Application: My Favorite Features: Entity Framework Code First and ASP.NET Web API.
LocalDB is just another engine that is used to access a SQL server database file .mdf -- just like SQLExpress. Visual Studio 2012 uses LocalDB by default while Visual Studio 2010 uses SQLExpress. Anyhow, you can just replace the connection string used in the tutorial with your actual database connection string.
The following tutorial shows how to create a Web API project and connect to a data source using Entity Framework: msdn
It should give you the gist of what needs to be done.

Application sharing

I Have a windows application made using VB.net and Mysql database. I want to install it on a Local network to be used by several users on different windows machines. How best can I do this?
You should have a look at
ClickOnce - A new VB.NET 2005
Deployment Tool
Using ClickOnce Deployment in
VB.NET
ClickOnce: Delivering .NET
Applications Via the Net
ClickOnce Deployment for Windows
Forms Applications
ClickOnce Deployment in .NET
Framework 2.0
You will have to install the application on each computer. But you can have on machine running the MySQL server to which the application will connect. This way all users can access the same data.