Thursday, June 17, 2010

Admission OPEN !!!!!!!!!!!!!!!!!!!!

Admission Open for first year BCA/BBA/MCA(Comm)
for more details visit Porf.Ramkirshna More A.C.S College Akurdi
Or contact 020 27650276 /9850515100

Friday, February 26, 2010

JDBC Connecting to Oracle

Thin & OCI Drivers
Oracle provides two main types of drivers.
The OCI driver.
The OCI (type 2) driver consists of java wrappers to the low-level Oracle Call Interface (OCI) libraries used by utilities like SQL*Plus to access the database server. The OCI driver offers potentially better performance that the thin driver. It however requires the OCI libraries to be installed on the local machine.

The ``thin'' driver.
Also referred to as type 4 driver, the thin driver is a pure Java implementation of Oracle's networking protocol (Net8). Being self-contained, it may be used on any machine with--or without Oracle installed--or even distributed with application classes in an applet.

Connecting to Oracle

We will review below how to access Oracle using both types of driver. First, we use the thin driver to connect to Oracle and execute an update statement. Note that the example below is only intended as an illustration. Try to understand the code. You will have opportunities for ``hands-on'' practice in the next section.

import java.io.*;
import java.sql.*;

public class OraThin {
public static void main(String[] args) {
try {
Connection con=null;
Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection(
"jdbc:oracle:thin:@machine_name:1521:database_name",
"scott",
"tiger");
Statement s=con.createStatement();
s.execute("
INSERT INTO BOOKS VALUES
(
'A Tale of Two Cities',
'William Shakespeare',
4567891231,
'5-JAN-1962'
)
");
s.close();
con.close();
} catch(Exception e){e.printStackTrace();}
}
}

* The package java.sql containing the JDBC classes is imported.
* The class OracleDriver, in the package oracle.jdbc.driver is dynamically loaded into the Java runtime using Class.forName(...).
* A connection is requested to the database corresponding to the connection URL with the statement DriverManager.getConnection(...).
* scott/tiger is an Oracle user/password.
* We use instances of the Connection and Statement classes to perform a database operation.
* The resources hold by these are released using their close() method.

If we want use the OCI driver, the JDBC connection URL above needs to be altered. The only element now required is the service name of the database: database_name. The remainder is resolved using the local Oracle configuration file.

DriverManager.getConnection(
"jdbc:oracle:oci8:@database_name", "scott","tiger");

Monday, February 22, 2010

Dining philosophers problem

Hi Friends(TYBCA Student) As i Promise you i m giveig the hint of Dining philosophers problem we suppose to solve using java
http://en.wikipedia.org/wiki/Dining_philosophers_problem
http://www.cs.mtu.edu/~shene/NSF-3/e-Book/MUTEX/TM-example-philos-1.html
http://jade.tilab.com/papers/EXP/Vadim.pdf

Wednesday, February 17, 2010

Advance Techniques for Presentation


Pune District Educational Association’s Prof .Ramkirshna More Arts, Commerce and Science College,Akurdi BBA/BCA/MCA (Commerce) Department Organizes One Day workshop On “Advance Techniques for Presentation ” on 17 Feb 2010 seminar give by Mr. Santosh Talghatti ,Reseach Engineer
ETH Limited , In this workshop Talghtti sir guide about advance techniques for One Screen Presentation and Video Conferencing .Student of Our dept Nilesh and Arshand give presentation on Unicode

Sunday, February 14, 2010

Java JMenu with action

Hi
friend As i commit u ppl I m giving you code of menu with action on menu
Hope so this code will help u in ur project

Prof.Prasad Sawant


/* BY
Prof.Prasad Sawant
BCA
Prof .Ramkrishana More A.C.S College */
import java.awt.*;
import java.awt.event.*;

import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.ButtonGroup;
import javax.swing.JMenuBar;
import javax.swing.KeyStroke;
import javax.swing.ImageIcon;

import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;
import javax.swing.JFrame;


//Used Action Listner for JMenuItem & JRadioButtonMenuItem
//Used Item Listner for JCheckBoxMenuItem

public class JMenuDemo implements ActionListener, ItemListener{
JTextArea jtAreaOutput;
JScrollPane jspPane;

public JMenuBar createJMenuBar() {
JMenuBar mainMenuBar;
JMenu menu1, menu2, submenu;
JMenuItem plainTextMenuItem, textIconMenuItem, iconMenuItem, subMenuItem;
JRadioButtonMenuItem rbMenuItem;
JCheckBoxMenuItem cbMenuItem;
ImageIcon icon = createImageIcon("jmenu.jpg");

mainMenuBar = new JMenuBar();

menu1 = new JMenu("Menu 1");
menu1.setMnemonic(KeyEvent.VK_M);
mainMenuBar.add(menu1);

//Creating the MenuItems
plainTextMenuItem = new JMenuItem("Menu item with Plain Text",
KeyEvent.VK_T);
//can be done either way for assigning shortcuts
//menuItem.setMnemonic(KeyEvent.VK_T);

// Accelerators, offer keyboard shortcuts to bypass navigating the menu hierarchy.
plainTextMenuItem.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_1,
ActionEvent.ALT_MASK));
plainTextMenuItem.addActionListener(this);
menu1.add(plainTextMenuItem);


textIconMenuItem = new JMenuItem("Menu Item with Text & Image", icon);
textIconMenuItem.setMnemonic(KeyEvent.VK_B);
textIconMenuItem.addActionListener(this);
menu1.add(textIconMenuItem);

//Menu Item with just an Image
iconMenuItem = new JMenuItem(icon);
iconMenuItem.setMnemonic(KeyEvent.VK_D);
iconMenuItem.addActionListener(this);
menu1.add(iconMenuItem);

menu1.addSeparator();
//Radio Button Menu items follow a seperator

ButtonGroup itemGroup = new ButtonGroup();

rbMenuItem = new JRadioButtonMenuItem("Menu Item with Radio Button");
rbMenuItem.setSelected(true);
rbMenuItem.setMnemonic(KeyEvent.VK_R);
itemGroup.add(rbMenuItem);
rbMenuItem.addActionListener(this);
menu1.add(rbMenuItem);

rbMenuItem = new JRadioButtonMenuItem("Menu Item 2 with Radio Button");
itemGroup.add(rbMenuItem);
rbMenuItem.addActionListener(this);
menu1.add(rbMenuItem);

menu1.addSeparator();
//Radio Button Menu items follow a seperator
cbMenuItem = new JCheckBoxMenuItem("Menu Item with check box");
cbMenuItem.setMnemonic(KeyEvent.VK_C);
cbMenuItem.addItemListener(this);
menu1.add(cbMenuItem);

cbMenuItem = new JCheckBoxMenuItem("Menu Item 2 with check box");
cbMenuItem.addItemListener(this);
menu1.add(cbMenuItem);

menu1.addSeparator();
//Sub Menu follows a seperator
submenu = new JMenu("Sub Menu");
submenu.setMnemonic(KeyEvent.VK_S);

subMenuItem = new JMenuItem("Sub MenuItem 1");
subMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_2,
ActionEvent.CTRL_MASK));
subMenuItem.addActionListener(this);
submenu.add(subMenuItem);

subMenuItem = new JMenuItem("Sub MenuItem 2");
submenu.add(subMenuItem);
subMenuItem.addActionListener(this);
menu1.add(submenu);

//Build second menu in the menu bar.
menu2 = new JMenu("Menu 2");
menu2.setMnemonic(KeyEvent.VK_N);
mainMenuBar.add(menu2);

return mainMenuBar;
}

public Container createContentPane() {
//Create the content-pane-to-be.
JPanel jplContentPane = new JPanel(new BorderLayout());
jplContentPane.setLayout(new BorderLayout());//Can do it either way to set layout
jplContentPane.setOpaque(true);

//Create a scrolled text area.
jtAreaOutput = new JTextArea(5, 30);
jtAreaOutput.setEditable(false);
jspPane = new JScrollPane(jtAreaOutput);

//Add the text area to the content pane.
jplContentPane.add(jspPane, BorderLayout.CENTER);

return jplContentPane;
}

/** Returns an ImageIcon, or null if the path was invalid. */
protected static ImageIcon createImageIcon(String path) {
java.net.URL imgURL = JMenuDemo.class.getResource(path);
if (imgURL != null) {
return new ImageIcon(imgURL);
} else {
System.err.println("Couldn't find image file: " + path);
return null;
}
}

private static void createGUI() {
JFrame.setDefaultLookAndFeelDecorated(true);

//Create and set up the window.
JFrame frame = new JFrame("JMenu Usage Demo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JMenuDemo app = new JMenuDemo();
frame.setJMenuBar(app.createJMenuBar());
frame.setContentPane(app.createContentPane());

frame.setSize(500, 300);
frame.setVisible(true);
}

public void actionPerformed(ActionEvent e) {
JMenuItem source = (JMenuItem)(e.getSource());
String s = "Menu Item source: " + source.getText()
+ " (an instance of " + getClassName(source) + ")";
jtAreaOutput.append(s + "\n");
jtAreaOutput.setCaretPosition(jtAreaOutput.getDocument().getLength());
}

public void itemStateChanged(ItemEvent e) {
JMenuItem source = (JMenuItem)(e.getSource());
String s = "Menu Item source: " + source.getText()
+ " (an instance of " + getClassName(source) + ")"
+ "\n"
+ " State of check Box: "
+ ((e.getStateChange() == ItemEvent.SELECTED) ?
"selected":"unselected");
jtAreaOutput.append(s + "\n");
jtAreaOutput.setCaretPosition(jtAreaOutput.getDocument().getLength());
}

// Returns the class name, no package info
protected String getClassName(Object o) {
String classString = o.getClass().getName();
int dotIndex = classString.lastIndexOf(".");
return classString.substring(dotIndex+1); //Returns only Class name
}

public static void main(String[] args) {

javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createGUI();
}
});
}


}

Friday, February 5, 2010

Chetan Rockssssssss


We are very happy to declare that our student Chetan Gaikwad has runner up in RDX C-ZAR compilation ie. C Programming held In Prof. Ramkrishna More Art commerce and Science College Akurdi .In C-ZAR Chetan has face compilation with 41 students of different colleges .We are wishing all the best for Chetan’s future life .


Staff Members
BCA
Prof.Ramkirshna More A.C.S College Akurdi