I can'ts ee data in Test tables

19 views
Skip to first unread message

Shree

unread,
Nov 9, 2010, 1:14:14 PM11/9/10
to CloudBase
Hi,

Question 1
--------------------
I have installed and set up cloudbase. I followed all step in
tutorial. I can see all tables in squirrel, but when I try to use
'select * from test_table1' , I can't see any data. Have I missed any
step ?

Question 2
----------------------------
Also, I have set up Oracle database connection. I can see all tables
with data. But. when I tried to set up database link between cloudbase
and oracle database, I get errors. What's the correct syntax for
dabase link connectin to oracle database?

Thanks,
Shree

Tarandeep Singh

unread,
Nov 9, 2010, 1:35:22 PM11/9/10
to cloudba...@googlegroups.com
did you run $CLOUDBASE_HOME/test/bin/setup ?
This script creates the test tables...

If yes and if you are still not seeing any data, please check logs and report any error/exception that you see.

For database link, the syntax is given on the cloudbase documentation page (copying it here)-

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

In order to use a database link, it is required to include the RDBMS JDBC driver in the java CLASSPATH (one can copy the RDBMS JDBC driver in $CLOUDBASE_HOME/lib directory and CloudBase will pick it from there).


Syntax for Database Link creation-

CREATE DATABASE LINK <linkname>
CONNECTION URL ‘jdbc_conn_url_for_rdbms’
JDBCDRIVER ‘rdbms_jdbc_driver_class_name’
[ USER username PASSWORD password ]
[ jdbc_property val, jdbc_property val ...]


For example, to make a link to MS-SQL Server, download the JDBC driver and add it to CLASSPATH or copy in $CLOUDBASE_HOME/lib directory. Run the following SQL-


CREATE DATABASE LINK sql_server_link
CONNECTION URL ‘jdbc:sqlserver://your_host:8888;user=user;password=password;databaseName=your_database’
jdbcdriver 'com.microsoft.sqlserver.jdbc.SQLServerDriver'

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

Please note once you have copied your Oracle jdbc jar file, you need to *Restart* cloudbase server so that it picks up the driver jar.




--
You received this message because you are subscribed to the Google Groups "CloudBase" group.
To post to this group, send email to cloudba...@googlegroups.com.
To unsubscribe from this group, send email to cloudbase-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cloudbase-users?hl=en.


Prashant Shindgikar

unread,
Nov 9, 2010, 2:29:28 PM11/9/10
to cloudba...@googlegroups.com
Thanks for the quick response.
I did not do the the setup step. btw, I can create my own tables by imorting file and I can see the data. I will do as you suggested and let you know.
 
As far as database link is concerned, I used the syntax by refering to the documentation. But wondering if there is any oracle specific syntax?
 
-Shree

Tarandeep Singh

unread,
Nov 9, 2010, 2:55:06 PM11/9/10
to cloudba...@googlegroups.com
On Tue, Nov 9, 2010 at 11:29 AM, Prashant Shindgikar <shind...@gmail.com> wrote:
Thanks for the quick response.
I did not do the the setup step. btw, I can create my own tables by imorting file and I can see the data. I will do as you suggested and let you know.
 
As far as database link is concerned, I used the syntax by refering to the documentation. But wondering if there is any oracle specific syntax?
 

since behind the scene it makes use of jdbc driver, so there no specific syntax for oracle. Just refer to oracle's jdbc driver's documentation to get the url, port etc.
 

Mycloud

unread,
Nov 10, 2010, 5:04:45 PM11/10/10
to CloudBase
I am getting following error


$ pwd
/usr/local/cloudbase-1.3.1/test/bin

pshindgikar@praslaptop /usr/local/cloudbase-1.3.1/test/bin
$ ./setup
java.lang.NoClassDefFoundError: com/business/cloudbase/test/Setup
Exception in thread "main"

----------------------------------------------------
bin=`dirname "$0"`
bin=`cd "$bin"; pwd`

export CLOUDBASE_HOME=/usr/local/cloudbase-1.3.1
export CLOUDBASE_JDBC_DRIVER_JAR=/usr/local/cloudbase-1.3.1/build/jar/
cloudbasejdbc*.jar
export CLOUDBASE_TEST_JAR=/usr/local/cloudbase-1.3.1/build/jar/
cloudbasetest*.jar
export CLASSPATH=${CLASSPATH}:${CLOUDBASE_JDBC_DRIVER_JAR}:$
{CLOUDBASE_TEST_JAR}
export propsFile=${CLOUDBASE_HOME}/test/cloudbase-jdbc.props
export testTablesDir=${CLOUDBASE_HOME}/test/tables

export CLASSPATH=${CLASSPATH}:/Cygwin/usr/local/cloudbase-1.3.1/build/
classes/test:/Cygwin/home/pshindgikar/hadoop-0.20.2/hadoop-0.20.2-
core.jar:/Cygwin/home/pshindgikar/hadoop-0.20.2/hadoop-0.20.2-
examples.jar:/Cygwin/usr/local/cloudbase-1.3.1/build/jar/
cloudbasejdbc-1.3.jar:/Cygwin/usr/local/cloudbase-1.3.1/build/jar/
cloudbasetest-1.3.jar

java -cp "$CLASSPATH" com.business.cloudbase.test.Setup ${propsFile} $
{testTablesDir}




On Nov 9, 11:55 am, Tarandeep Singh <tarand...@gmail.com> wrote:
> On Tue, Nov 9, 2010 at 11:29 AM, Prashant Shindgikar
> <shindgi...@gmail.com>wrote:
>
> > Thanks for the quick response.
> > I did not do the the setup step. btw, I can create my own tables by
> > imorting file and I can see the data. I will do as you suggested and let you
> > know.
>
> > As far as database link is concerned, I used the syntax by refering to the
> > documentation. But wondering if there is any oracle specific syntax?
>
> since behind the scene it makes use of jdbc driver, so there no specific
> syntax for oracle. Just refer to oracle's jdbc driver's documentation to get
> the url, port etc.
>
>
>
>
>
>
>
> > -Shree
>
> > On Tue, Nov 9, 2010 at 1:35 PM, Tarandeep Singh <tarand...@gmail.com>wrote:
>
> >> did you run *$CLOUDBASE_HOME/test/bin/setup* ?
> >> This script creates the test tables...
>
> >> If yes and if you are still not seeing any data, please check logs and
> >> report any error/exception that you see.
>
> >> For database link, the syntax is given on the cloudbase documentation page
> >> (copying it here)-
>
> >> ---------------------------------------------------------------------------
>
> >> In order to use a database link, it is required to include the RDBMS JDBC
> >> driver in the java CLASSPATH (one can copy the RDBMS JDBC driver in *
> >> $CLOUDBASE_HOME/lib* directory and CloudBase will pick it from there).
>
> >> Syntax for Database Link creation-
>
> >> *CREATE DATABASE LINK <linkname>
> >> CONNECTION URL ‘jdbc_conn_url_for_rdbms’
> >> JDBCDRIVER ‘rdbms_jdbc_driver_class_name’
> >> [ USER username PASSWORD password ]
> >> [ jdbc_property val, jdbc_property val ...] *
>
> >> For example, to make a link to MS-SQL Server, download the JDBC driver and
> >> add it to CLASSPATH or copy in *$CLOUDBASE_HOME/lib* directory. Run the
> >> following SQL-
>
> >> *CREATE DATABASE LINK sql_server_link
> >> CONNECTION URL
> >> ‘jdbc:sqlserver://your_host:8888;user=user;password=password;databaseName=your_database’
>
> >> jdbcdriver 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
> >> *
>
> >> *----------------------------------------------------------------*
>
> >> Please note once you have copied your Oracle jdbc jar file, you need to
> >> *Restart* cloudbase server so that it picks up the driver jar.
>
> >> On Tue, Nov 9, 2010 at 10:14 AM, Shree <shindgi...@gmail.com> wrote:
>
> >>> Hi,
>
> >>> Question 1
> >>> --------------------
> >>> I have installed and set up cloudbase. I followed all step in
> >>> tutorial. I can see all tables in squirrel, but when I try to use
> >>> 'select * from test_table1' , I can't see any data. Have I missed any
> >>> step ?
>
> >>> Question 2
> >>> ----------------------------
> >>> Also, I have set up Oracle database connection. I can see all tables
> >>> with data. But. when I tried to set up database link between cloudbase
> >>> and oracle database, I get errors. What's the correct syntax for
> >>> dabase link connectin to oracle database?
>
> >>> Thanks,
> >>> Shree
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "CloudBase" group.
> >>> To post to this group, send email to cloudba...@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> cloudbase-use...@googlegroups.com<cloudbase-users%2Bunsu...@googlegroups.com>
> >>> .
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/cloudbase-users?hl=en.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "CloudBase" group.
> >> To post to this group, send email to cloudba...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> cloudbase-use...@googlegroups.com<cloudbase-users%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/cloudbase-users?hl=en.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "CloudBase" group.
> > To post to this group, send email to cloudba...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > cloudbase-use...@googlegroups.com<cloudbase-users%2Bunsu...@googlegroups.com>
> > .

Mycloud

unread,
Nov 10, 2010, 7:08:45 PM11/10/10
to CloudBase
I have managed to run the Setup files. The problem was with CLASSPATH.
I set yo CYGWIN_HOME and attached to /usr/local and it worked.

But, not I am facing brand new problem. The setup scripts is throwing
following error. Any help ?

-------------------------------------------------------
Creating table- test_table1
Error occured while creating test tables-
java.sql.SQLException: [com.business.cloudbase.common.CBException: An
error occu
red while copying data from local file system to hadoop file system:
Could not g
et files list for /usr/local/cloudbase-1.3.1/test/tables\test_table1,
com.busine
ss.cloudbase.common.CBException: An error occured while copying data
from local
file system to hadoop file system: Could not get files list for /usr/
local/cloud
base-1.3.1/test/tables\test_table1, at
com.business.cloudbase.statement.crea
te.CreateTableStmt.execute(CreateTableStmt.java:94), at
com.business.cloudbas
e.net.ClientHandler$CommandExecutor.handleSQL(ClientHandler.java:
487), at com.b
usiness.cloudbase.net.ClientHandler
$CommandExecutor.run(ClientHandler.java:163)]

at
com.business.cloudbase.CBStatement.checkForError(CBStatement.java:113
)
at
com.business.cloudbase.CBStatement.processResponseHeader(CBStatement.
java:102)
at
com.business.cloudbase.CBStatement.executeQuery(CBStatement.java:143)

at com.business.cloudbase.test.Setup.createTables(Unknown
Source)
at com.business.cloudbase.test.Setup.createTables(Unknown
Source)
at com.business.cloudbase.test.Setup.main(Unknown Source)

Tarandeep Singh

unread,
Nov 10, 2010, 7:13:16 PM11/10/10
to cloudba...@googlegroups.com
it is again related to cygwin -


"Could not get files list for /usr/local/cloudbase-1.3.1/test/tables\test_table1"

Do you see the path separator "\" instead of "/" between tables and test_table1?
I guess you need to fix these path separators so that you can run on cygwin.


To unsubscribe from this group, send email to cloudbase-use...@googlegroups.com.

Mycloud

unread,
Nov 10, 2010, 7:40:33 PM11/10/10
to CloudBase



$ echo $PATH
/cygdrive/c/app/pshindgikar/product/11.2.0/dbhome_1/bin:/cygdrive/c/
WINDOWS/syem32:/usr/bin:/cygdrive/c/jdk16/bin:/usr/local/
cloudbase-1.3.1

$ echo $propsFile
/Cygwin/usr/local/cloudbase-1.3.1/test/cloudbase-jdbc.props

$ echo $testTablesDir
/usr/local/cloudbase-1.3.1/test/tables


But still having following issue. Can you please let me know what I
should do here to fix this issue usr/local/cloudbase-1.3.1/test/
tables\test_table1'

GOT SQL: drop index INDEX_TEST_TABLE1_C4
GOT SQL: drop table test_table1
GOT SQL: drop table test_table2
GOT SQL: drop table test_table3
GOT SQL: drop table test_table4
GOT SQL: drop table test_table5
GOT SQL: drop index INDEX_TEST_TABLE7_C1
GOT SQL: drop index INDEX_TEST_TABLE7_C2
GOT SQL: drop index INDEX_TEST_TABLE7_C3
GOT SQL: drop index INDEX_TEST_TABLE7_C4
GOT SQL: drop index INDEX_TEST_TABLE7_C5
GOT SQL: drop index INDEX_TEST_TABLE7_C6
GOT SQL: drop index INDEX_TEST_TABLE7_C7
GOT SQL: drop table test_table7
GOT SQL: drop table test_table8
GOT SQL: drop table dual
GOT SQL: unregister udf 'fun1'
GOT SQL: unregister udf 'fun2'
GOT SQL: unregister udf 'fun3'
GOT SQL: drop table udt_table1
GOT SQL: drop table xml_table1
GOT SQL: drop table json_table1
GOT SQL: drop table csv_table1
GOT SQL: drop table test_table9
GOT SQL: unregister udt book
GOT SQL: create table test_table1 ( c1 varchar, c2 int, c3 float, c4
varchar) co
lumn sep '|' import data from '/usr/local/cloudbase-1.3.1/test/tables
\test_table
1'





On Nov 10, 4:13 pm, Tarandeep Singh <tarand...@gmail.com> wrote:
> it is again related to cygwin -
>
> "Could not get files list for /usr/local/cloudbase-1.3.1/test/tables*\*
> > <cloudbase-users%2Bunsu...@googlegroups.com<cloudbase-users%252Buns...@googlegroups.com>
>
> > > > >>> .
> > > > >>> For more options, visit this group at
> > > > >>>http://groups.google.com/group/cloudbase-users?hl=en.
>
> > > > >> --
> > > > >> You received this message because you are subscribed to the Google
> > Groups
> > > > >> "CloudBase" group.
> > > > >> To post to this group, send email to
> > cloudba...@googlegroups.com.
> > > > >> To unsubscribe from this group, send email to
> > > > >> cloudbase-use...@googlegroups.com<cloudbase-users%2Bunsu...@googlegroups.com>
> > <cloudbase-users%2Bunsu...@googlegroups.com<cloudbase-users%252Buns...@googlegroups.com>
>
> > > > >> .
> > > > >> For more options, visit this group at
> > > > >>http://groups.google.com/group/cloudbase-users?hl=en.
>
> > > > >  --
> > > > > You received this message because you are subscribed to the Google
> > Groups
> > > > > "CloudBase" group.
> > > > > To post to this group, send email to
> > cloudba...@googlegroups.com.
> > > > > To unsubscribe from this group, send email to
> > > > > cloudbase-use...@googlegroups.com<cloudbase-users%2Bunsu...@googlegroups.com>
> > <cloudbase-users%2Bunsu...@googlegroups.com<cloudbase-users%252Buns...@googlegroups.com>

Mycloud

unread,
Nov 10, 2010, 8:39:05 PM11/10/10
to CloudBase

May be code issue. Because even though , I tried to run using current
directory, the code is attaching "\" character to file name.

GOT SQL: create table test_table1 ( c1 varchar, c2 int, c3 float, c4
varchar) column sep '|' import data from '.\test_table1'
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages