You are not logged in.

jan

Beginner

  • "jan" started this thread

Posts: 1

Date of registration: Apr 25th 2009

  • Send private message

1

Saturday, April 25th 2009, 5:17pm

Like creating a database

Hello to all, I would want to know like creating an application using the database. I make a premise, I do not have experience with this with Jabaco and am leaving from 0. Thanks. If then there were a help in order to use jabaco, even in Italian, to sare disposed to pay it.

  • "StefanSchnell" is male

Posts: 102

Date of registration: Mar 13th 2009

Location: Oberirsen - Germany

Occupation: Senior Software Engineer

Hobbies: Programming aund Photography

  • Send private message

2

Saturday, April 25th 2009, 7:58pm

Creating a database

Hello Jan,
welcome to Jabaco.
Believe me, it is not very difficult to work with Jabaco and databases. Now I describe one way with the JDBC (Java DataBase Connection) ODBC (Open DataBase Connection) Bridge - JDBC-ODBC-Bridge. The first step is to create a user DSN (Data Source Name). Open your administration and choose Datasources (ODBC), activate the tab User-DSN and apply the button add. Choose the driver you need, e.g. Microsoft Access Driver (*.mdb) and apply the button complete. Fill the field data source name and choose the database you want. The data source name is very important for the following program, maybe test.
Now you can code your program:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Dim Con As java#sql#Connection
Dim Order As java#sql#Statement
Dim Data As ResultSet

'Load the JDBC-ODBC driver
Class.forName "sun.jdbc.odbc.JdbcOdbcDriver"

'Create connection to the database test
Set Con = java#sql#DriverManager.getConnection("jdbc:odbc:test")

'Create a statement and send the command to the database
Set Order = Con.createStatement
Set Data = Order.executeQuery("SELECT * FROM employee;")

'Print the result
Do While Data.next()
  java#lang#system.out.println(Data.getString("Emp_Name"))
Loop
  
'Close the connection
Con.close

That is it. :D

If you want to work with other types of databases, look at the installed ODBC drivers, whether the type is supported. Look at this thread, there is another way to work with a database -here SQLite.

Cheers
Stefan
Visit my personal or commercial site
If you have questions or suggestions, write me an eMail or
meet me here

  • "Gianluca Mombelli" is male

Posts: 6

Date of registration: Apr 23rd 2009

Location: Italia

  • Send private message

3

Sunday, April 26th 2009, 8:54am

class ResultSet not found

To the string that you have advised - Set to me With = java#sql#DriverManager.getConnection (" jdbc: odbc: test") - I have replaced test with the name of database (Mydatabase) and - Set Data = Order.executeQuery("SELECT * FROM Cognome;"). I have found an error " class ResultSet not found". Why? Where I have mistaken? Grazie.

  • "StefanSchnell" is male

Posts: 102

Date of registration: Mar 13th 2009

Location: Oberirsen - Germany

Occupation: Senior Software Engineer

Hobbies: Programming aund Photography

  • Send private message

4

Sunday, April 26th 2009, 9:09am

Hello Gianluca,
welcome to Jabaco too.
I think you must add the class to your classpath. Press F1, open rt.jar - this is the Java RunTime - and open the nodes Java > SQL and activate SQL, or the class ResultSet, beneath SQL. Thus the error would have to be eliminated.
Cheers
Stefan
Visit my personal or commercial site
If you have questions or suggestions, write me an eMail or
meet me here

  • "Gianluca Mombelli" is male

Posts: 6

Date of registration: Apr 23rd 2009

Location: Italia

  • Send private message

5

Sunday, April 26th 2009, 9:34am

database

Eureca works!

This post has been edited 2 times, last edit by "Gianluca Mombelli" (Apr 26th 2009, 9:54am)


  • "Gianluca Mombelli" is male

Posts: 6

Date of registration: Apr 23rd 2009

Location: Italia

  • Send private message

6

Sunday, April 26th 2009, 10:02am

thanks, thousands thanks master. You have been much kind one. I will be able to still ask in future because being creed is all' beginning dl my way. I would want to create some text connected to the database with the possibility to save the data, to eliminate them or to insert some of new. I do not want to ask too much therefore you see you when to instruct me.

GRAJESHGUP1

Beginner

Posts: 1

Date of registration: Apr 22nd 2010

  • Send private message

7

Friday, April 23rd 2010, 4:09pm

database connectivity

Hi... I am new to jabaco

I am trying to connect ms access database.. everything is working fine but at last where I am accessing recordset its giving me error "java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state"

here is code which I am using

---------------------------------------

Dim Con As java#sql#Connection
Dim Order As java#sql#Statement
Dim Data As ResultSet


Public Sub Form_Load()
'Load the JDBC-ODBC driver
Class.forName "sun.jdbc.odbc.JdbcOdbcDriver"

'Create connection to the database test
Set Con = java#sql#DriverManager.getConnection("jdbc:odbc:payout")

'Create a statement and send the command to the database
Set Order = Con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY)
Set Data = Order.executeQuery("SELECT * FROM pin")

'Print the result
MsgBox Data.getString("Pin_no")


'Close the connection
Con.close

----------------------------------------------------------------------------



any help on this topic ....much appreciated

spysonic

Trainee

  • "spysonic" is male

Posts: 88

Date of registration: Jul 11th 2014

About me: A beginner programmer.

Location: ...Jabaco Academy

Occupation: i have some but still not enough...

Hobbies: Jabaco

  • Send private message

8

Monday, July 28th 2014, 7:59am

may i know what it does?

Source code

1
Set Order = Con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY)
.
.
Spare me, im new to Programming

Rate this thread
WoltLab Burning Board