As per my knowledge, If we learn these things with practicing some code related to these topics, we can start for any kind of development or to take in part in java related exams.
I am sorry to say that I can’t share these things right now. But in near future, a brief of these topics will be here.
[polldaddy poll=7717806]
]]>An API (application programming interface) is a term meaning the functions/methods in a library that we can call to ask it to do things for us – the interface to the library.
An SDK ( (software development kit) is a library (often with extra tool applications, data files and sample code) that aid us in developing code that uses a particular system (e.g. extension code for using features of an operating system (Windows SDK), drawing 3D graphics via a particular system (DirectX SDK), writing add-ins to extend other applications (Office SDK), or writing code to make a device like an Arduino or a mobile phone do what we want)
[Collected]
HAPPY NEW YEAR, 2014
Before starting this we must read these two posts carefully.
We will use Jar to exe convert wizard 1.8 to convert our jar files to exe.
Step 1 : Install the software and run the wizard.
Step 2: Browse project.jar and press next.
Step 3: Select Console application or Windows gui application
Step 4: Select the Main class from where the software will start and keep “select a picture for splash window” blank.
Step 5: enable Support System tray and disable all others disable. [or, you can change as your requirements.]
Step 6: Add others Jars you have used like mysql-connector.jar . Usually these are on project/dist/lib/ if you are using Netbeans IDE.
Step 6: press Next and Finish.
Step 7 : We got the converted exe file of our jar file.
Thanks for reading this post.
Ujjal
]]>
Code Written in JAVA
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.*; import java.sql.*; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Ujjal Suttra Dhar */ class create_backup{ String database = "your_database_name", user = "root", password = "pass"; Connection m_Connection = null; Statement m_Statement = null; ResultSet m_ResultSet; String m_Driver = "com.mysql.jdbc.Driver"; String m_Url = "jdbc:mysql://localhost:3306/" + database; public create_backup(){ /*Eshtablishment of Connection of java code with MySQL using JDBC You must read my previous post to know further about this. */ try { Class.forName(m_Driver); m_Connection = DriverManager.getConnection(m_Url, user, password); //Create Statement object m_Statement = m_Connection.createStatement(); } catch (Exception ex) { ex.printStackTrace(); } try { //Database will be stored in filename.sql which can be import on MySQl as backup BufferedWriter out = new BufferedWriter(new FileWriter("kernel_school.sql")); //Now here is the informations about the database of which backup will be created String dump = "C:/Program Files/MySQL/MySQL Server 5.0/bin/mysqldump " //Path to mysql + "--host=localhost" //Mysql hostname + "--port=3306" //Mysql portnumber + "--user=root" //Mysql username + "--password=pass" //Mysql password + "--add-drop-table" //Add a DROP TABLE statement before each CREATE TABLE statement + "--add-drop-database" //Add a DROP DATABASE statement before each CREATE DATABASE statement + "--complete-insert" //Use complete INSERT statements that include column names. + "--extended-insert" //Use multiple-row INSERT syntax that include several VALUES lists + "kernel_school"; //Mysql databasename //executing the command through process. Process run = Runtime.getRuntime().exec(dump); /*resultant SQL informations are here on the br which can be read line by line . And at the same time it will be written on another sql file.*/ InputStream in = run.getInputStream(); InputStreamReader isr = new InputStreamReader(in); BufferedReader br = new BufferedReader(isr); String line = null; while ((line = br.readLine())!=null) { out.write(line); out.newLine(); } out.flush(); // must flush or close the file after completing the task. // int exitVal = run.waitFor();//when exitVal is ,then the process is completed } catch (Throwable t) { t.printStackTrace(); } }//constructor } // class public class autobackup { public static void main(String a[]){ new create_backup(); } }
Code Written in PHP
]]>
Step 1:
Find some books on basic mathematics/Number theory.
* Elementary Number Theory with Applications
-Thomas Koshy
*Concrete mathematics
-Donald Knuth
Step 2:
Select an programming language to implement those mathematics you have learnt. Now-a-days, C,C++,JAVA are the most popular and widely used languages. If you are newbie ,I will suggest you to learn C because it is the most efficient and easiest language. Most of important softwares and Some of operating systems are developed in C.
If you are not a student of CSE background,don’t be afraid,because you can learn it easily. You can learn this from this book. Ya, all the newbies who are related to CSE,this book is also for you too.
*Art Of Programming contest
* Programming with C
-Bayron Gottfried
Step 3:
Now you have learnt a little bit of mathematics, at least one of the programming languages, it’s time go now. What to do? You have to solve problems.There are many Online judges,In which there are thousands of problem descriptions with the facility to judge your solution ,is it ok or not,I will mention “Is the solution efficient or not”.
As you are newbie I will suggest you to use UVA at first . For this you have to open an account on this site.you can browse problems of their site. The first job of you to read the problem carefully,find the solution ,then code it.
What is coding? If you have learnt any of the programming languages, don’t ask it again.You have to write a code which will take input and provide with outputs as the problem description. After login you have to submit your solution to the onlinejudge.That machine will judge your solution in RE (runtime error),TE (time limit exceede),WA (wrong answer),PA (presentation error) and AC (accepted).
When submitting,you have take some measures which will be described below.
You can track your progress from here .
After solving some of problems,you should not be limited only in a single judges.
Here are some others OJs.
*SPOJ
*Light OJ
*Topcoder
*Codeforces
Here are some of websites/blogs which can be useful for you too.
*Smilitude
* UVA FORUM
Problems solving with C:
A sample code for submitting a problem is given below.
[code]
#include<stdio.h>
int main()
{
int testcase,input,I,j,k;
while(scanf(“%d”,&input)==1)
{
//your solution exists here
If(input ==2)
printf(“two”);
else
printf(“Not two”);
}
return 0;
}
[/code]
Now practice problem solving. You must attend free online contests to judge yourself.
For any kind of help or suggestions
I am here
[code]
jar cf jar-file input-file(s)
[/code]
//input files are .class files and extra files you have used like music,jars etc.
For more you can see this Creating JAR files
After creation you must specify the main class using manifest.
Ways to update a jar file with manifest……
I have created a text file as manifest like aaa.txt which contains
[Code]Main-class: Mainclassname
[/Code]
//a new line or enter must be pressed after Mainclassname before saving
Updating a jar file with main class, you have to move the jar file to the BIN folder of JDK. Then using the command propmt executed the commands given below:
[code]
jar umf aaa.txt calender.jar
jar xvf calender.jar
type META-INFMANIFEST.MF
[/code]
Now double-click on your JAR file….
Thanking you,
Ujjal
We must download a mysql-connector-java-5.0.8-bin.jar and keep it to
C:Program FilesJavajdk1.6.0_01jrelibext
In java programming, before coding we must established a connection between interpreter and MySQL.
at first we must import some built in packages.they are:
[code]
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Connection;
//now finally in our main job i.e establishing the connection
Connection m_Connection = null;
Statement m_Statement = null;
ResultSet m_ResultSet = null;
String m_Driver ="com.mysql.jdbc.Driver";
String m_Url = "jdbc:mysql://localhost:3306/databasename";
//Loading driver
try {
Class.forName(m_Driver);
}
catch (ClassNotFoundException ex) {
ex.printStackTrace();
}
String query = "";
try {
//Create connection object
m_Connection = DriverManager.getConnection(m_Url, user, password);
//Create Statement object
m_Statement = m_Connection.createStatement();
query = "SELECT * FROM ";
query+=tablename;
//Execute the query
m_ResultSet = m_Statement.executeQuery(query);
String s,t="";
//Loop through the results
while (m_ResultSet.next()) {
s=m_ResultSet.getString(1); //here 1 means value of first coloumn
}//end for while loop
}
catch (SQLException ex) {
ex.printStackTrace();
System.out.println(query);
}
catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
finally {
try {
if (m_ResultSet != null)
m_ResultSet.close();
if (m_Statement != null)
m_Statement.close();
if (m_Connection != null)
m_Connection.close();
}
catch (SQLException ex) {
ex.printStackTrace();
}
}
[/code]