Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package beadando;
- import java.sql.*;
- /**
- *
- * @author Levente
- */
- public class Main {
- static Connection conn;
- /**
- * @param args the command line arguments
- */
- public static void kapcsolodas(){
- try{
- DriverManager.registerDriver(
- new oracle.jdbc.driver.OracleDriver());
- conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/XE","leva","xi1edil2");
- }
- catch(SQLException e){
- e.printStackTrace();
- }
- }
- public static void motorSelect(){
- try {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT * FROM MOTORKEREKPAR");
- System.out.println(rs);
- while (rs.next()){
- //rs.next();
- System.out.println(rs.getObject(1)+" "+rs.getObject(2)+" "+rs.getObject(3)+" "+rs.getObject(4)+" "+rs.getObject(5)+" "+rs.getObject(6)+" "+rs.getObject(7));
- }
- }
- catch (SQLException e){
- e.printStackTrace();
- }
- }
- public static void main(String[] args) {
- kapcsolodas();
- motorSelect();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement