Jabaco Source |
|
1 2 |
MV_STORE=FALSE e.g. conn = java#sql#DriverManager.getConnection("jdbc:h2:" & System.getProperty("user.dir")& "\Artikel;MV_STORE=FALSE;TRACE_LEVEL_FILE=0", "xyz", "1234") |
This post has been edited 2 times, last edit by "Dani" (Nov 13th 2015, 2:13pm)
Source code |
|
1 2 |
java#lang#Class.forName("com.mysql.jdbc.Driver") conn = DriverManager.getConnection("jdbc:mysql://localhost/database", "username", "password") |
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
And i tried opeing the database attached with your given sample program but I There is no data there.. no matter how i try to view the Artikel.h2 database on your project
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Jabaco Source |
|
1 |
conn = java#sql#DriverManager.getConnection("jdbc:h2:tcp://localhost/~/test","x", "x") |
This post has been edited 1 times, last edit by "spysonic" (Aug 28th 2014, 4:26am)
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
This post has been edited 1 times, last edit by "spysonic" (Aug 28th 2014, 9:30am)
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
'Jabaco sample by Dani: 'h2 Database ConnectionPool Setup 'http://www.h2database.com/html/main.html Option Explicit Import org#h2#Driver Import org#h2#jdbcx#JdbcConnectionPool Global strQry As String Global cp As org#h2#jdbcx#JdbcConnectionPool Global conn As java#sql#Connection Global st As java#sql#Statement Global rs As java#sql#ResultSet Public Sub grdMain_init() 'within some Sub initialize the pool cp = JdbcConnectionPool.create("jdbc:h2:C:\tmp\ArtikelDB\Artikel;TRACE_LEVEL_FILE=0", "xyz", "1234") conn = cp.getConnection() strQry = "SELECT * FROM EINIGEARTIKEL WHERE ANZEIGEN = True ORDER BY BEZEICHNUNG ASC;" rs = conn.createStatement().executeQuery(strQry) conn.close() 'and fetching a new connection from the pool whereever needed... conn = cp.getConnection() strQry = "SELECT * FROM EINIGEARTIKEL WHERE ANZEIGEN = True AND BEZEICHNUNG LIKE '" & strBezeichnung & "%' ORDER BY BEZEICHNUNG ASC;" rs = conn.createStatement().executeQuery(strQry) 'or ' strQry = "DELETE FROM ARTIKEL " & _ ' "WHERE NRINTERN = " & grdMain.TextMatrix(grdMain.Row, 0) & ";" ' conn.createStatement().executeUpdate(strQry) conn.close() 'cp.dispose() End Sub |
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
Option Explicit 'Add sqlite-jdbc-3.8.11.2.jar to your Java instalation or class path... 'e.g.: 'C:\Program Files\Java\jre7\Lib\ext\sqlite-jdbc-3.8.11.2.jar' 'https://bitbucket.org/xerial/sqlite-jdbc/downloads 'https://bitbucket.org/xerial/sqlite-jdbc/overview 'https://github.com/xerial/sqlite-jdbc Import org#sqlite#JDBC ' Import java#sql#Connection ' Import java#sql#DriverManager ' Import java#sql#ResultSet ' Import java#sql#SQLException ' Import java#sql#Statement Dim strQry As String Dim conn As java#sql#Connection Dim st As java#sql#Statement Dim rs As java#sql#ResultSet Public Sub Form_Load() java#lang#Class.forName("org.sqlite.JDBC") 'sqlight 'adjust path...! conn = java#sql#DriverManager.getConnection("jdbc:sqlite:C:\test\Artikel.db") st = conn.createStatement() ' st.executeUpdate("DELETE FROM ARTIKEL WHERE ANZEIGEN = 0;") strQry = "SELECT * FROM ARTIKEL WHERE ANZEIGEN = 1 ORDER BY BEZEICHNUNG ASC;" rs = st.executeQuery(strQry) Do While rs.next() Debug.Print rs.getMetaData.getColumnName(1) Loop End Sub 'CREATE TABLE ARTIKEL (NRINTERN BIGINT(2000000000, 10) NOT NULL,NREXTERN VARCHAR(25),BEZEICHNUNG VARCHAR(10),BESCHREIBUNG VARCHAR(100),EAN13 VARCHAR(13),STEUER_ID INT(2000000000, 10),GRUPPE_ID INT(2000000000, 10),GANG_ID INT(2000000000, 10),REGAL_ID INT(2000000000, 10),FACH_ID INT(2000000000, 10),EK DECIMAL(10, 4),VK DECIMAL(10, 4),ANZEIGEN BOOLEAN,GESPERRT INT(2000000000, 10) ); |