Hello all.
I'm very new to Desktop Application programming and I just wanted to know what the best way to get data from the web is. On the web, I can just connect to a database and get the proper data. But I'm not sure if this is possible or if that's safe.
Tons of applications do stuff like this where they authenticate your username that you registered on the web. How do they do that?
The only other way I can think of doing it is through a REST API on the server (java application using HTTPS to get and send data).
By the way...Is there any way to change this stupid default icon?
http://gbanker.com/pic.tiff
Accessing secure data from the web with Java
Started by garrettgjb, Sep 11 2010 07:20 AM
3 replies to this topic
#1
Posted 11 September 2010 - 07:20 AM
|
|
|
#2
Posted 12 September 2010 - 01:07 AM
I think you can just connect to the database using JDBC (java database connectivity).
Do you mean the icon of a JFrame?
Quote
By the way...Is there any way to change this stupid default icon?
frame.setIconImage(image);
#3
Posted 12 September 2010 - 02:28 PM
Thanks for your help.
Code I used.
Now for the icon. I mean the icon that is in my doc when I start the application. So the application icon. Is that changed with the code above?
Code I used.
public void test()
{
Connection con = null;
try
{
Class.forName("com.mysql.jdbc.Driver");
con=(Connection) DriverManager.getConnection("jdbc:mysql://ip/table","username", "password");
Statement statement = (Statement) con.createStatement();
ResultSet result = statement.executeQuery("select * from articles");
while(result.next())
{
System.out.println("Body: " + result.getString("body"));
}
}
catch(Exception e)
{
e.printStackTrace();
System.out.println("Exception: " + e.getMessage());
}
finally
{
try
{
if(con != null)
{
con.close();
}
}
catch(SQLException e){};
}
}
Now for the icon. I mean the icon that is in my doc when I start the application. So the application icon. Is that changed with the code above?
#4
Posted 12 September 2010 - 10:12 PM
Changing the icon of a single .jar file isn't possible. There is software that wraps a .jar file into an .exe file and then you can set the icon of the exe file just like any other exe.


Sign In
Create Account

Back to top









